From 2cd2d717932d8617b56a5e87bc0edb1f0795f082 Mon Sep 17 00:00:00 2001 From: Jerome Touffe-Blin Date: Tue, 8 Sep 2015 06:01:04 +0700 Subject: [PATCH] 0.8.3 --- bower.json | 2 +- dist/angular-chart.js | 8 ++++---- dist/angular-chart.js.tar.gz | Bin 10796 -> 11043 bytes dist/angular-chart.min.css | 2 ++ dist/angular-chart.min.css.map | 1 + dist/angular-chart.min.js | 2 +- dist/angular-chart.min.js.map | 2 +- examples/charts.html | 2 +- package.json | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 dist/angular-chart.min.css create mode 100644 dist/angular-chart.min.css.map diff --git a/bower.json b/bower.json index 972cde3e..7a9e9397 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-chart.js", - "version": "0.8.2", + "version": "0.8.3", "main": [ "./dist/angular-chart.js", "./dist/angular-chart.css" diff --git a/dist/angular-chart.js b/dist/angular-chart.js index f7f5ef52..e6363e7e 100644 --- a/dist/angular-chart.js +++ b/dist/angular-chart.js @@ -1,11 +1,11 @@ (function (factory) { 'use strict'; - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['angular', 'chart'], factory); - } else if (typeof exports === 'object') { + if (typeof exports === 'object') { // Node/CommonJS module.exports = factory(require('angular'), require('chart.js')); + } else if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['angular', 'chart'], factory); } else { // Browser globals factory(angular, Chart); diff --git a/dist/angular-chart.js.tar.gz b/dist/angular-chart.js.tar.gz index cf31c42ade949cd3aac7fa27f198fb09a6f64bb9..aa703c3cae1b01a83a29cf2ee9620f5ac51b603e 100755 GIT binary patch literal 11043 zcmV+;E8Nr{iwFP!000021MPkJTN6pw==-yOMVpzCL|b-rgh9Wg2@o+dij2d{@O)2` zG^8O($4-Yu%>RDRQfn_ED0=UGM#h2aT27rhb+)SNuH*MlM_oUD+UodmGTRys|8xI8 z^Yio1mX{s;3qR?<^9#%K&z*(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(CI69Q98v@bqffC!ZzFn5M_Md^;{1SIC>)L#Ee^QrJD5GuKi|B|0MuBtiCc0M z?awTufXWMMF47;fjDm3TT+Jm0%rXwBH~dB%KdK<|wsB<{CdKXMq9l`r39B&Cos}#J zEAE`KinHd;nzKrzHJmAF6(!=EHEWeZ!%ABv(jI1#4x$$<;P(A_!bmBi{>l3qy|#aXX3#R}72>E=7m@hT-$GDbSTJ* zm22KFrAR(6R(|HPMP@T&nPGxUEKX3Mf> z`o?rwCamfCvZnMbNSHOHcVWh?Dg6slW=-i`m@{h{?)juy)1YUwW=-jvOPgg&S5e}u zzd3W(-!gTUJ>ss(vuuw1p4qePnPyF&Q-ohWe~wK9JA+n{P~US3t?U%p)HxZk&thAW zOUKd;GU?Q`-JX(3t9;OuR9fYOrsdKqA2ltR*0goam`*Ft0%ZxH@;ztF09DFm(|5cm zrIxk3CF`G-RqLxz$xSp{X03mmvfo!bd`*6>9E8~uY~5j}?yeU~wzDYBR?#kguRL2> zjW{*YRT~`^)Pf6HSM$@vKU8b7)rleiB0J_Jl zT^VBJ({@eat6b);JV)J6>aIMJncQ8sGJnA)hud*47vw4{!kWJ^Mmpv_?SI*|&me5NP$9h8W>r;AV zZ@jDf?q8MGD?_zxUN2MjrX=<<)>M|+OLr+t?WKF#Z2-!J=s@=Lbql6n&r8Y(nVYOzHGP1O8Aw% zxn7>}%eo6bbILE1gj(#%?LukZFH?%j5`UQ}&Yt-z|2V)mr~Wcktaxf!$m9Z()l-v! znfrE6$3A&B$|VHL=q{ZROfT>bDZz|EU!N1K9QX3HV5S!Nu6e;S^eRXUrqJit7Rckr qZ$0t5CGX-mb!+YdUoE(ke{+KU`}6P5zd!#SKmP~SwSs#9v;Y7TJsAc7 diff --git a/dist/angular-chart.min.css b/dist/angular-chart.min.css new file mode 100644 index 00000000..cb6f7ec0 --- /dev/null +++ b/dist/angular-chart.min.css @@ -0,0 +1,2 @@ +.chart-legend,.bar-legend,.line-legend,.pie-legend,.radar-legend,.polararea-legend,.doughnut-legend{list-style-type:none;margin-top:5px;text-align:center;-webkit-padding-start:0;-moz-padding-start:0;padding-left:0}.chart-legend li,.bar-legend li,.line-legend li,.pie-legend li,.radar-legend li,.polararea-legend li,.doughnut-legend li{display:inline-block;white-space:nowrap;position:relative;margin-bottom:4px;border-radius:5px;padding:2px 8px 2px 28px;font-size:smaller;cursor:default}.chart-legend li span,.bar-legend li span,.line-legend li span,.pie-legend li span,.radar-legend li span,.polararea-legend li span,.doughnut-legend li span{display:block;position:absolute;left:0;top:0;width:20px;height:20px;border-radius:5px} +/*# sourceMappingURL=angular-chart.min.css.map */ \ No newline at end of file diff --git a/dist/angular-chart.min.css.map b/dist/angular-chart.min.css.map new file mode 100644 index 00000000..6025c52b --- /dev/null +++ b/dist/angular-chart.min.css.map @@ -0,0 +1 @@ +{"version":3,"names":[],"mappings":"","sources":["angular-chart.css"],"sourcesContent":[".chart-legend,\n.bar-legend,\n.line-legend,\n.pie-legend,\n.radar-legend,\n.polararea-legend,\n.doughnut-legend {\n list-style-type: none;\n margin-top: 5px;\n text-align: center;\n /* NOTE: Browsers automatically add 40px of padding-left to all lists, so we should offset that, otherwise the legend is off-center */\n -webkit-padding-start: 0;\n /* Webkit */\n -moz-padding-start: 0;\n /* Mozilla */\n padding-left: 0;\n /* IE (handles all cases, really, but we should also include the vendor-specific properties just to be safe) */\n}\n.chart-legend li,\n.bar-legend li,\n.line-legend li,\n.pie-legend li,\n.radar-legend li,\n.polararea-legend li,\n.doughnut-legend li {\n display: inline-block;\n white-space: nowrap;\n position: relative;\n margin-bottom: 4px;\n border-radius: 5px;\n padding: 2px 8px 2px 28px;\n font-size: smaller;\n cursor: default;\n}\n.chart-legend li span,\n.bar-legend li span,\n.line-legend li span,\n.pie-legend li span,\n.radar-legend li span,\n.polararea-legend li span,\n.doughnut-legend li span {\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 20px;\n height: 20px;\n border-radius: 5px;\n}\n"],"file":"angular-chart.min.css","sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/angular-chart.min.js b/dist/angular-chart.min.js index dc700941..c98e0b38 100644 --- a/dist/angular-chart.min.js +++ b/dist/angular-chart.min.js @@ -1,2 +1,2 @@ -!function(t){"use strict";"function"==typeof define&&define.amd?define(["angular","chart"],t):"object"==typeof exports?module.exports=t(require("angular"),require("chart.js")):t(angular,Chart)}(function(t,e){"use strict";function n(){var n={},r={Chart:e,getOptions:function(e){var r=e&&n[e]||{};return t.extend({},n,r)}};this.setOptions=function(e,r){return r?(n[e]=t.extend(n[e]||{},r),void 0):(r=e,n=t.extend(n,r),void 0)},this.$get=function(){return r}}function r(n,r){function o(t,e){return t&&e&&t.length&&e.length?Array.isArray(t[0])?t.length===e.length&&t.every(function(t,n){return t.length===e[n].length}):e.reduce(i,0)>0?t.length===e.length:!1:!1}function i(t,e){return t+e}function c(t,e,n){return function(r){var a=e.getPointsAtEvent||e.getBarsAtEvent||e.getSegmentsAtEvent;if(a){var o=a.call(e,r);t[n](o,r),t.$apply()}}}function l(r,a){for(var o=t.copy(a.colours||n.getOptions(r).colours||e.defaults.global.colours);o.length>16&255,r=e>>8&255,a=255&e;return[n,r,a]}function p(e,n,r,a){return{labels:e,datasets:n.map(function(e,n){return t.extend({},a[n],{label:r[n],data:e})})}}function v(e,n,r){return e.map(function(e,a){return t.extend({},r[a],{label:e,value:n[a],color:r[a].strokeColor,highlight:r[a].pointHighlightStroke})})}function y(t,e){var n=t.parent(),r=n.find("chart-legend"),a=""+e.generateLegend()+"";r.length?r.replaceWith(a):n.append(a)}function C(t,e,n,r){Array.isArray(n.data[0])?t.datasets.forEach(function(t,n){(t.points||t.bars).forEach(function(t,r){t.value=e[n][r]})}):t.segments.forEach(function(t,n){t.value=e[n]}),t.update(),n.$emit("update",t),n.legend&&"false"!==n.legend&&y(r,t)}function b(t){return!t||Array.isArray(t)&&!t.length||"object"==typeof t&&!Object.keys(t).length}function m(r,a){var o=t.extend({},e.defaults.global,n.getOptions(r),a.options);return o.responsive}return function(e){return{restrict:"CA",scope:{data:"=?",labels:"=?",options:"=?",series:"=?",colours:"=?",getColour:"=?",chartType:"=",legend:"@",click:"=?",hover:"=?",chartData:"=?",chartLabels:"=?",chartOptions:"=?",chartSeries:"=?",chartColours:"=?",chartLegend:"@",chartClick:"=?",chartHover:"=?"},link:function(i,u){function f(t,e){i.$watch(t,function(t){"undefined"!=typeof t&&(i[e]=t)})}function h(n,r){if(!b(n)&&!t.equals(n,r)){var a=e||i.chartType;a&&(w&&w.destroy(),d(a))}}function d(e){if(m(e,i)&&0===u[0].clientHeight&&0===A.clientHeight)return r(function(){d(e)},50,!1);if(i.data&&i.data.length){i.getColour="function"==typeof i.getColour?i.getColour:s,i.colours=l(e,i);var a=u[0],o=a.getContext("2d"),f=Array.isArray(i.data[0])?p(i.labels,i.data,i.series||[],i.colours):v(i.labels,i.data,i.colours),h=t.extend({},n.getOptions(e),i.options);w=new n.Chart(o)[e](f,h),i.$emit("create",w),["hover","click"].forEach(function(t){i[t]&&(a["click"===t?"onclick":"onmousemove"]=c(i,w,t))}),i.legend&&"false"!==i.legend&&y(u,w)}}function g(t){if("undefined"!=typeof console&&"test"!==n.getOptions().env){var e="function"==typeof console.warn?console.warn:console.log;i[t]&&e.call(console,'"%s" is deprecated and will be removed in a future version. Please use "chart-%s" instead.',t,t)}}var w,A=document.createElement("div");A.className="chart-container",u.replaceWith(A),A.appendChild(u[0]),a&&window.G_vmlCanvasManager.initElement(u[0]),["data","labels","options","series","colours","legend","click","hover"].forEach(g),f("chartData","data"),f("chartLabels","labels"),f("chartOptions","options"),f("chartSeries","series"),f("chartColours","colours"),f("chartLegend","legend"),f("chartClick","click"),f("chartHover","hover"),i.$watch("data",function(t,n){if(t&&t.length&&(!Array.isArray(t[0])||t[0].length)){var r=e||i.chartType;if(r){if(w){if(o(t,n))return C(w,t,i,u);w.destroy()}d(r)}}},!0),i.$watch("series",h,!0),i.$watch("labels",h,!0),i.$watch("options",h,!0),i.$watch("colours",h,!0),i.$watch("chartType",function(e,n){b(e)||t.equals(e,n)||(w&&w.destroy(),d(e))}),i.$on("$destroy",function(){w&&w.destroy()})}}}}e.defaults.global.responsive=!0,e.defaults.global.multiTooltipTemplate="<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>",e.defaults.global.colours=["#97BBCD","#DCDCDC","#F7464A","#46BFBD","#FDB45C","#949FB1","#4D5360"];var a="object"==typeof window.G_vmlCanvasManager&&null!==window.G_vmlCanvasManager&&"function"==typeof window.G_vmlCanvasManager.initElement;return a&&(e.defaults.global.animation=!1),t.module("chart.js",[]).provider("ChartJs",n).factory("ChartJsFactory",["ChartJs","$timeout",r]).directive("chartBase",["ChartJsFactory",function(t){return new t}]).directive("chartLine",["ChartJsFactory",function(t){return new t("Line")}]).directive("chartBar",["ChartJsFactory",function(t){return new t("Bar")}]).directive("chartRadar",["ChartJsFactory",function(t){return new t("Radar")}]).directive("chartDoughnut",["ChartJsFactory",function(t){return new t("Doughnut")}]).directive("chartPie",["ChartJsFactory",function(t){return new t("Pie")}]).directive("chartPolarArea",["ChartJsFactory",function(t){return new t("PolarArea")}])}); +!function(t){"use strict";"object"==typeof exports?module.exports=t(require("angular"),require("chart.js")):"function"==typeof define&&define.amd?define(["angular","chart"],t):t(angular,Chart)}(function(t,e){"use strict";function n(){var n={},r={Chart:e,getOptions:function(e){var r=e&&n[e]||{};return t.extend({},n,r)}};this.setOptions=function(e,r){return r?(n[e]=t.extend(n[e]||{},r),void 0):(r=e,n=t.extend(n,r),void 0)},this.$get=function(){return r}}function r(n,r){function o(t,e){return t&&e&&t.length&&e.length?Array.isArray(t[0])?t.length===e.length&&t.every(function(t,n){return t.length===e[n].length}):e.reduce(i,0)>0?t.length===e.length:!1:!1}function i(t,e){return t+e}function c(t,e,n){return function(r){var a=e.getPointsAtEvent||e.getBarsAtEvent||e.getSegmentsAtEvent;if(a){var o=a.call(e,r);t[n](o,r),t.$apply()}}}function l(r,a){for(var o=t.copy(a.colours||n.getOptions(r).colours||e.defaults.global.colours);o.length>16&255,r=e>>8&255,a=255&e;return[n,r,a]}function p(e,n,r,a){return{labels:e,datasets:n.map(function(e,n){return t.extend({},a[n],{label:r[n],data:e})})}}function v(e,n,r){return e.map(function(e,a){return t.extend({},r[a],{label:e,value:n[a],color:r[a].strokeColor,highlight:r[a].pointHighlightStroke})})}function y(t,e){var n=t.parent(),r=n.find("chart-legend"),a=""+e.generateLegend()+"";r.length?r.replaceWith(a):n.append(a)}function C(t,e,n,r){Array.isArray(n.data[0])?t.datasets.forEach(function(t,n){(t.points||t.bars).forEach(function(t,r){t.value=e[n][r]})}):t.segments.forEach(function(t,n){t.value=e[n]}),t.update(),n.$emit("update",t),n.legend&&"false"!==n.legend&&y(r,t)}function b(t){return!t||Array.isArray(t)&&!t.length||"object"==typeof t&&!Object.keys(t).length}function m(r,a){var o=t.extend({},e.defaults.global,n.getOptions(r),a.options);return o.responsive}return function(e){return{restrict:"CA",scope:{data:"=?",labels:"=?",options:"=?",series:"=?",colours:"=?",getColour:"=?",chartType:"=",legend:"@",click:"=?",hover:"=?",chartData:"=?",chartLabels:"=?",chartOptions:"=?",chartSeries:"=?",chartColours:"=?",chartLegend:"@",chartClick:"=?",chartHover:"=?"},link:function(i,u){function f(t,e){i.$watch(t,function(t){"undefined"!=typeof t&&(i[e]=t)})}function h(n,r){if(!b(n)&&!t.equals(n,r)){var a=e||i.chartType;a&&(w&&w.destroy(),d(a))}}function d(e){if(m(e,i)&&0===u[0].clientHeight&&0===A.clientHeight)return r(function(){d(e)},50,!1);if(i.data&&i.data.length){i.getColour="function"==typeof i.getColour?i.getColour:s,i.colours=l(e,i);var a=u[0],o=a.getContext("2d"),f=Array.isArray(i.data[0])?p(i.labels,i.data,i.series||[],i.colours):v(i.labels,i.data,i.colours),h=t.extend({},n.getOptions(e),i.options);w=new n.Chart(o)[e](f,h),i.$emit("create",w),["hover","click"].forEach(function(t){i[t]&&(a["click"===t?"onclick":"onmousemove"]=c(i,w,t))}),i.legend&&"false"!==i.legend&&y(u,w)}}function g(t){if("undefined"!=typeof console&&"test"!==n.getOptions().env){var e="function"==typeof console.warn?console.warn:console.log;i[t]&&e.call(console,'"%s" is deprecated and will be removed in a future version. Please use "chart-%s" instead.',t,t)}}var w,A=document.createElement("div");A.className="chart-container",u.replaceWith(A),A.appendChild(u[0]),a&&window.G_vmlCanvasManager.initElement(u[0]),["data","labels","options","series","colours","legend","click","hover"].forEach(g),f("chartData","data"),f("chartLabels","labels"),f("chartOptions","options"),f("chartSeries","series"),f("chartColours","colours"),f("chartLegend","legend"),f("chartClick","click"),f("chartHover","hover"),i.$watch("data",function(t,n){if(t&&t.length&&(!Array.isArray(t[0])||t[0].length)){var r=e||i.chartType;if(r){if(w){if(o(t,n))return C(w,t,i,u);w.destroy()}d(r)}}},!0),i.$watch("series",h,!0),i.$watch("labels",h,!0),i.$watch("options",h,!0),i.$watch("colours",h,!0),i.$watch("chartType",function(e,n){b(e)||t.equals(e,n)||(w&&w.destroy(),d(e))}),i.$on("$destroy",function(){w&&w.destroy()})}}}}e.defaults.global.responsive=!0,e.defaults.global.multiTooltipTemplate="<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>",e.defaults.global.colours=["#97BBCD","#DCDCDC","#F7464A","#46BFBD","#FDB45C","#949FB1","#4D5360"];var a="object"==typeof window.G_vmlCanvasManager&&null!==window.G_vmlCanvasManager&&"function"==typeof window.G_vmlCanvasManager.initElement;return a&&(e.defaults.global.animation=!1),t.module("chart.js",[]).provider("ChartJs",n).factory("ChartJsFactory",["ChartJs","$timeout",r]).directive("chartBase",["ChartJsFactory",function(t){return new t}]).directive("chartLine",["ChartJsFactory",function(t){return new t("Line")}]).directive("chartBar",["ChartJsFactory",function(t){return new t("Bar")}]).directive("chartRadar",["ChartJsFactory",function(t){return new t("Radar")}]).directive("chartDoughnut",["ChartJsFactory",function(t){return new t("Doughnut")}]).directive("chartPie",["ChartJsFactory",function(t){return new t("Pie")}]).directive("chartPolarArea",["ChartJsFactory",function(t){return new t("PolarArea")}])}); //# sourceMappingURL=angular-chart.min.js.map \ No newline at end of file diff --git a/dist/angular-chart.min.js.map b/dist/angular-chart.min.js.map index 3913b707..74a85b89 100644 --- a/dist/angular-chart.min.js.map +++ b/dist/angular-chart.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["angular-chart.min.js"],"names":["factory","define","amd","exports","module","require","angular","Chart","ChartJsProvider","options","ChartJs","getOptions","type","typeOptions","extend","this","setOptions","customOptions","$get","ChartJsFactory","$timeout","canUpdateChart","newVal","oldVal","length","Array","isArray","every","element","index","reduce","sum","carry","val","getEventHandler","scope","chart","action","evt","atEvent","getPointsAtEvent","getBarsAtEvent","getSegmentsAtEvent","activePoints","call","$apply","getColours","colours","copy","defaults","global","data","push","getColour","map","convertColour","colour","hexToRgb","substr","getRandomColour","getRandomInt","fillColor","rgba","strokeColor","pointColor","pointStrokeColor","pointHighlightFill","pointHighlightStroke","min","max","Math","floor","random","alpha","usingExcanvas","join","concat","hex","bigint","parseInt","r","g","b","getDataSets","labels","series","datasets","item","i","label","getData","value","color","highlight","setLegend","elem","$parent","parent","$oldLegend","find","legend","generateLegend","replaceWith","append","updateChart","values","forEach","dataset","points","bars","dataItem","j","segments","segment","update","$emit","isEmpty","Object","keys","isResponsive","responsive","restrict","chartType","click","hover","chartData","chartLabels","chartOptions","chartSeries","chartColours","chartLegend","chartClick","chartHover","link","aliasVar","fromName","toName","$watch","resetChart","equals","destroy","createChart","clientHeight","container","cvs","ctx","getContext","deprecated","attr","console","env","warn","log","document","createElement","className","appendChild","window","G_vmlCanvasManager","initElement","$on","multiTooltipTemplate","animation","provider","directive"],"mappings":"CAAC,SAAUA,GACT,YACsB,mBAAXC,SAAyBA,OAAOC,IAEzCD,QAAQ,UAAW,SAAUD,GACD,gBAAZG,SAEhBC,OAAOD,QAAUH,EAAQK,QAAQ,WAAYA,QAAQ,aAGrDL,EAAQM,QAASC,QAEnB,SAAUD,EAASC,GACnB,YAyCA,SAASC,KACP,GAAIC,MACAC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D,OAAOC,oBAC0C,kBAA1CD,QAAOC,mBAAmBC,WAInC,OAFIrF,KAAenE,EAAM0C,SAASC,OAAOgH,WAAY,GAE9C5J,EAAQF,OAAO,eACnB+J,SAAS,UAAW3J,GACpBR,QAAQ,kBAAmB,UAAW,WAAYmB,IAClDiJ,UAAU,aAAc,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,MACjFiJ,UAAU,aAAc,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,WAChGiJ,UAAU,YAAa,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,UAC/FiJ,UAAU,cAAe,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,YACjGiJ,UAAU,iBAAkB,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,eACpGiJ,UAAU,YAAa,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,UAC/FiJ,UAAU,kBAAmB,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe","file":"angular-chart.min.js","sourcesContent":["(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['angular', 'chart'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory(require('angular'), require('chart.js'));\n } else {\n // Browser globals\n factory(angular, Chart);\n }\n}(function (angular, Chart) {\n 'use strict';\n\n Chart.defaults.global.responsive = true;\n Chart.defaults.global.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';\n\n Chart.defaults.global.colours = [\n '#97BBCD', // blue\n '#DCDCDC', // light grey\n '#F7464A', // red\n '#46BFBD', // green\n '#FDB45C', // yellow\n '#949FB1', // grey\n '#4D5360' // dark grey\n ];\n\n var usingExcanvas = typeof window.G_vmlCanvasManager === 'object' &&\n window.G_vmlCanvasManager !== null &&\n typeof window.G_vmlCanvasManager.initElement === 'function';\n\n if (usingExcanvas) Chart.defaults.global.animation = false;\n\n return angular.module('chart.js', [])\n .provider('ChartJs', ChartJsProvider)\n .factory('ChartJsFactory', ['ChartJs', '$timeout', ChartJsFactory])\n .directive('chartBase', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory(); }])\n .directive('chartLine', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Line'); }])\n .directive('chartBar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Bar'); }])\n .directive('chartRadar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Radar'); }])\n .directive('chartDoughnut', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Doughnut'); }])\n .directive('chartPie', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Pie'); }])\n .directive('chartPolarArea', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('PolarArea'); }]);\n\n /**\n * Wrapper for chart.js\n * Allows configuring chart js using the provider\n *\n * angular.module('myModule', ['chart.js']).config(function(ChartJsProvider) {\n * ChartJsProvider.setOptions({ responsive: true });\n * ChartJsProvider.setOptions('Line', { responsive: false });\n * })))\n */\n function ChartJsProvider () {\n var options = {};\n var ChartJs = {\n Chart: Chart,\n getOptions: function (type) {\n var typeOptions = type && options[type] || {};\n return angular.extend({}, options, typeOptions);\n }\n };\n\n /**\n * Allow to set global options during configuration\n */\n this.setOptions = function (type, customOptions) {\n // If no type was specified set option for the global object\n if (! customOptions) {\n customOptions = type;\n options = angular.extend(options, customOptions);\n return;\n }\n // Set options for the specific chart\n options[type] = angular.extend(options[type] || {}, customOptions);\n };\n\n this.$get = function () {\n return ChartJs;\n };\n }\n\n function ChartJsFactory (ChartJs, $timeout) {\n return function chart (type) {\n return {\n restrict: 'CA',\n scope: {\n data: '=?',\n labels: '=?',\n options: '=?',\n series: '=?',\n colours: '=?',\n getColour: '=?',\n chartType: '=',\n legend: '@',\n click: '=?',\n hover: '=?',\n\n chartData: '=?',\n chartLabels: '=?',\n chartOptions: '=?',\n chartSeries: '=?',\n chartColours: '=?',\n chartLegend: '@',\n chartClick: '=?',\n chartHover: '=?'\n },\n link: function (scope, elem/*, attrs */) {\n var chart, container = document.createElement('div');\n container.className = 'chart-container';\n elem.replaceWith(container);\n container.appendChild(elem[0]);\n\n if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);\n\n ['data', 'labels', 'options', 'series', 'colours', 'legend', 'click', 'hover'].forEach(deprecated);\n function aliasVar (fromName, toName) {\n scope.$watch(fromName, function (newVal) {\n if (typeof newVal === 'undefined') return;\n scope[toName] = newVal;\n });\n }\n /* provide backward compatibility to \"old\" directive names, by\n * having an alias point from the new names to the old names. */\n aliasVar('chartData', 'data');\n aliasVar('chartLabels', 'labels');\n aliasVar('chartOptions', 'options');\n aliasVar('chartSeries', 'series');\n aliasVar('chartColours', 'colours');\n aliasVar('chartLegend', 'legend');\n aliasVar('chartClick', 'click');\n aliasVar('chartHover', 'hover');\n\n // Order of setting \"watch\" matter\n\n scope.$watch('data', function (newVal, oldVal) {\n if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) return;\n var chartType = type || scope.chartType;\n if (! chartType) return;\n\n if (chart) {\n if (canUpdateChart(newVal, oldVal)) return updateChart(chart, newVal, scope, elem);\n chart.destroy();\n }\n\n createChart(chartType);\n }, true);\n\n scope.$watch('series', resetChart, true);\n scope.$watch('labels', resetChart, true);\n scope.$watch('options', resetChart, true);\n scope.$watch('colours', resetChart, true);\n\n scope.$watch('chartType', function (newVal, oldVal) {\n if (isEmpty(newVal)) return;\n if (angular.equals(newVal, oldVal)) return;\n if (chart) chart.destroy();\n createChart(newVal);\n });\n\n scope.$on('$destroy', function () {\n if (chart) chart.destroy();\n });\n\n function resetChart (newVal, oldVal) {\n if (isEmpty(newVal)) return;\n if (angular.equals(newVal, oldVal)) return;\n var chartType = type || scope.chartType;\n if (! chartType) return;\n\n // chart.update() doesn't work for series and labels\n // so we have to re-create the chart entirely\n if (chart) chart.destroy();\n\n createChart(chartType);\n }\n\n function createChart (type) {\n if (isResponsive(type, scope) && elem[0].clientHeight === 0 && container.clientHeight === 0) {\n return $timeout(function () {\n createChart(type);\n }, 50, false);\n }\n if (! scope.data || ! scope.data.length) return;\n scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour;\n scope.colours = getColours(type, scope);\n var cvs = elem[0], ctx = cvs.getContext('2d');\n var data = Array.isArray(scope.data[0]) ?\n getDataSets(scope.labels, scope.data, scope.series || [], scope.colours) :\n getData(scope.labels, scope.data, scope.colours);\n var options = angular.extend({}, ChartJs.getOptions(type), scope.options);\n chart = new ChartJs.Chart(ctx)[type](data, options);\n scope.$emit('create', chart);\n\n ['hover', 'click'].forEach(function (action) {\n if (scope[action])\n cvs[action === 'click' ? 'onclick' : 'onmousemove'] = getEventHandler(scope, chart, action);\n });\n if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);\n }\n\n function deprecated (attr) {\n if (typeof console !== 'undefined' && ChartJs.getOptions().env !== 'test') {\n var warn = typeof console.warn === 'function' ? console.warn : console.log;\n if (!! scope[attr]) {\n warn.call(console, '\"%s\" is deprecated and will be removed in a future version. ' +\n 'Please use \"chart-%s\" instead.', attr, attr);\n }\n }\n }\n }\n };\n };\n\n function canUpdateChart (newVal, oldVal) {\n if (newVal && oldVal && newVal.length && oldVal.length) {\n return Array.isArray(newVal[0]) ?\n newVal.length === oldVal.length && newVal.every(function (element, index) {\n return element.length === oldVal[index].length; }) :\n oldVal.reduce(sum, 0) > 0 ? newVal.length === oldVal.length : false;\n }\n return false;\n }\n\n function sum (carry, val) {\n return carry + val;\n }\n\n function getEventHandler (scope, chart, action) {\n return function (evt) {\n var atEvent = chart.getPointsAtEvent || chart.getBarsAtEvent || chart.getSegmentsAtEvent;\n if (atEvent) {\n var activePoints = atEvent.call(chart, evt);\n scope[action](activePoints, evt);\n scope.$apply();\n }\n };\n }\n\n function getColours (type, scope) {\n var colours = angular.copy(scope.colours ||\n ChartJs.getOptions(type).colours ||\n Chart.defaults.global.colours\n );\n while (colours.length < scope.data.length) {\n colours.push(scope.getColour());\n }\n return colours.map(convertColour);\n }\n\n function convertColour (colour) {\n if (typeof colour === 'object' && colour !== null) return colour;\n if (typeof colour === 'string' && colour[0] === '#') return getColour(hexToRgb(colour.substr(1)));\n return getRandomColour();\n }\n\n function getRandomColour () {\n var colour = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];\n return getColour(colour);\n }\n\n function getColour (colour) {\n return {\n fillColor: rgba(colour, 0.2),\n strokeColor: rgba(colour, 1),\n pointColor: rgba(colour, 1),\n pointStrokeColor: '#fff',\n pointHighlightFill: '#fff',\n pointHighlightStroke: rgba(colour, 0.8)\n };\n }\n\n function getRandomInt (min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n\n function rgba (colour, alpha) {\n if (usingExcanvas) {\n // rgba not supported by IE8\n return 'rgb(' + colour.join(',') + ')';\n } else {\n return 'rgba(' + colour.concat(alpha).join(',') + ')';\n }\n }\n\n // Credit: http://stackoverflow.com/a/11508164/1190235\n function hexToRgb (hex) {\n var bigint = parseInt(hex, 16),\n r = (bigint >> 16) & 255,\n g = (bigint >> 8) & 255,\n b = bigint & 255;\n\n return [r, g, b];\n }\n\n function getDataSets (labels, data, series, colours) {\n return {\n labels: labels,\n datasets: data.map(function (item, i) {\n return angular.extend({}, colours[i], {\n label: series[i],\n data: item\n });\n })\n };\n }\n\n function getData (labels, data, colours) {\n return labels.map(function (label, i) {\n return angular.extend({}, colours[i], {\n label: label,\n value: data[i],\n color: colours[i].strokeColor,\n highlight: colours[i].pointHighlightStroke\n });\n });\n }\n\n function setLegend (elem, chart) {\n var $parent = elem.parent(),\n $oldLegend = $parent.find('chart-legend'),\n legend = '' + chart.generateLegend() + '';\n if ($oldLegend.length) $oldLegend.replaceWith(legend);\n else $parent.append(legend);\n }\n\n function updateChart (chart, values, scope, elem) {\n if (Array.isArray(scope.data[0])) {\n chart.datasets.forEach(function (dataset, i) {\n (dataset.points || dataset.bars).forEach(function (dataItem, j) {\n dataItem.value = values[i][j];\n });\n });\n } else {\n chart.segments.forEach(function (segment, i) {\n segment.value = values[i];\n });\n }\n chart.update();\n scope.$emit('update', chart);\n if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);\n }\n\n function isEmpty (value) {\n return ! value ||\n (Array.isArray(value) && ! value.length) ||\n (typeof value === 'object' && ! Object.keys(value).length);\n }\n\n function isResponsive (type, scope) {\n var options = angular.extend({}, Chart.defaults.global, ChartJs.getOptions(type), scope.options);\n return options.responsive;\n }\n }\n}));\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["angular-chart.min.js"],"names":["factory","exports","module","require","define","amd","angular","Chart","ChartJsProvider","options","ChartJs","getOptions","type","typeOptions","extend","this","setOptions","customOptions","$get","ChartJsFactory","$timeout","canUpdateChart","newVal","oldVal","length","Array","isArray","every","element","index","reduce","sum","carry","val","getEventHandler","scope","chart","action","evt","atEvent","getPointsAtEvent","getBarsAtEvent","getSegmentsAtEvent","activePoints","call","$apply","getColours","colours","copy","defaults","global","data","push","getColour","map","convertColour","colour","hexToRgb","substr","getRandomColour","getRandomInt","fillColor","rgba","strokeColor","pointColor","pointStrokeColor","pointHighlightFill","pointHighlightStroke","min","max","Math","floor","random","alpha","usingExcanvas","join","concat","hex","bigint","parseInt","r","g","b","getDataSets","labels","series","datasets","item","i","label","getData","value","color","highlight","setLegend","elem","$parent","parent","$oldLegend","find","legend","generateLegend","replaceWith","append","updateChart","values","forEach","dataset","points","bars","dataItem","j","segments","segment","update","$emit","isEmpty","Object","keys","isResponsive","responsive","restrict","chartType","click","hover","chartData","chartLabels","chartOptions","chartSeries","chartColours","chartLegend","chartClick","chartHover","link","aliasVar","fromName","toName","$watch","resetChart","equals","destroy","createChart","clientHeight","container","cvs","ctx","getContext","deprecated","attr","console","env","warn","log","document","createElement","className","appendChild","window","G_vmlCanvasManager","initElement","$on","multiTooltipTemplate","animation","provider","directive"],"mappings":"CAAC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GAAOA,EAAMwG,eAnJ3BrI,EAAM0C,SAASC,OAAOsE,YAAa,EACnCjH,EAAM0C,SAASC,OAAO+G,qBAAuB,6DAE7C1J,EAAM0C,SAASC,OAAOH,SACpB,UACA,UACA,UACA,UACA,UACA,UACA,UAGF,IAAI2B,GAAqD,gBAA9BmF,QAAOC,oBACF,OAA9BD,OAAOC,oBAC0C,kBAA1CD,QAAOC,mBAAmBC,WAInC,OAFIrF,KAAenE,EAAM0C,SAASC,OAAOgH,WAAY,GAE9C5J,EAAQJ,OAAO,eACnBiK,SAAS,UAAW3J,GACpBR,QAAQ,kBAAmB,UAAW,WAAYmB,IAClDiJ,UAAU,aAAc,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,MACjFiJ,UAAU,aAAc,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,WAChGiJ,UAAU,YAAa,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,UAC/FiJ,UAAU,cAAe,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,YACjGiJ,UAAU,iBAAkB,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,eACpGiJ,UAAU,YAAa,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe,UAC/FiJ,UAAU,kBAAmB,iBAAkB,SAAUjJ,GAAkB,MAAO,IAAIA,GAAe","file":"angular-chart.min.js","sourcesContent":["(function (factory) {\n 'use strict';\n if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory(require('angular'), require('chart.js'));\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['angular', 'chart'], factory);\n } else {\n // Browser globals\n factory(angular, Chart);\n }\n}(function (angular, Chart) {\n 'use strict';\n\n Chart.defaults.global.responsive = true;\n Chart.defaults.global.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';\n\n Chart.defaults.global.colours = [\n '#97BBCD', // blue\n '#DCDCDC', // light grey\n '#F7464A', // red\n '#46BFBD', // green\n '#FDB45C', // yellow\n '#949FB1', // grey\n '#4D5360' // dark grey\n ];\n\n var usingExcanvas = typeof window.G_vmlCanvasManager === 'object' &&\n window.G_vmlCanvasManager !== null &&\n typeof window.G_vmlCanvasManager.initElement === 'function';\n\n if (usingExcanvas) Chart.defaults.global.animation = false;\n\n return angular.module('chart.js', [])\n .provider('ChartJs', ChartJsProvider)\n .factory('ChartJsFactory', ['ChartJs', '$timeout', ChartJsFactory])\n .directive('chartBase', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory(); }])\n .directive('chartLine', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Line'); }])\n .directive('chartBar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Bar'); }])\n .directive('chartRadar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Radar'); }])\n .directive('chartDoughnut', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Doughnut'); }])\n .directive('chartPie', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Pie'); }])\n .directive('chartPolarArea', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('PolarArea'); }]);\n\n /**\n * Wrapper for chart.js\n * Allows configuring chart js using the provider\n *\n * angular.module('myModule', ['chart.js']).config(function(ChartJsProvider) {\n * ChartJsProvider.setOptions({ responsive: true });\n * ChartJsProvider.setOptions('Line', { responsive: false });\n * })))\n */\n function ChartJsProvider () {\n var options = {};\n var ChartJs = {\n Chart: Chart,\n getOptions: function (type) {\n var typeOptions = type && options[type] || {};\n return angular.extend({}, options, typeOptions);\n }\n };\n\n /**\n * Allow to set global options during configuration\n */\n this.setOptions = function (type, customOptions) {\n // If no type was specified set option for the global object\n if (! customOptions) {\n customOptions = type;\n options = angular.extend(options, customOptions);\n return;\n }\n // Set options for the specific chart\n options[type] = angular.extend(options[type] || {}, customOptions);\n };\n\n this.$get = function () {\n return ChartJs;\n };\n }\n\n function ChartJsFactory (ChartJs, $timeout) {\n return function chart (type) {\n return {\n restrict: 'CA',\n scope: {\n data: '=?',\n labels: '=?',\n options: '=?',\n series: '=?',\n colours: '=?',\n getColour: '=?',\n chartType: '=',\n legend: '@',\n click: '=?',\n hover: '=?',\n\n chartData: '=?',\n chartLabels: '=?',\n chartOptions: '=?',\n chartSeries: '=?',\n chartColours: '=?',\n chartLegend: '@',\n chartClick: '=?',\n chartHover: '=?'\n },\n link: function (scope, elem/*, attrs */) {\n var chart, container = document.createElement('div');\n container.className = 'chart-container';\n elem.replaceWith(container);\n container.appendChild(elem[0]);\n\n if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);\n\n ['data', 'labels', 'options', 'series', 'colours', 'legend', 'click', 'hover'].forEach(deprecated);\n function aliasVar (fromName, toName) {\n scope.$watch(fromName, function (newVal) {\n if (typeof newVal === 'undefined') return;\n scope[toName] = newVal;\n });\n }\n /* provide backward compatibility to \"old\" directive names, by\n * having an alias point from the new names to the old names. */\n aliasVar('chartData', 'data');\n aliasVar('chartLabels', 'labels');\n aliasVar('chartOptions', 'options');\n aliasVar('chartSeries', 'series');\n aliasVar('chartColours', 'colours');\n aliasVar('chartLegend', 'legend');\n aliasVar('chartClick', 'click');\n aliasVar('chartHover', 'hover');\n\n // Order of setting \"watch\" matter\n\n scope.$watch('data', function (newVal, oldVal) {\n if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) return;\n var chartType = type || scope.chartType;\n if (! chartType) return;\n\n if (chart) {\n if (canUpdateChart(newVal, oldVal)) return updateChart(chart, newVal, scope, elem);\n chart.destroy();\n }\n\n createChart(chartType);\n }, true);\n\n scope.$watch('series', resetChart, true);\n scope.$watch('labels', resetChart, true);\n scope.$watch('options', resetChart, true);\n scope.$watch('colours', resetChart, true);\n\n scope.$watch('chartType', function (newVal, oldVal) {\n if (isEmpty(newVal)) return;\n if (angular.equals(newVal, oldVal)) return;\n if (chart) chart.destroy();\n createChart(newVal);\n });\n\n scope.$on('$destroy', function () {\n if (chart) chart.destroy();\n });\n\n function resetChart (newVal, oldVal) {\n if (isEmpty(newVal)) return;\n if (angular.equals(newVal, oldVal)) return;\n var chartType = type || scope.chartType;\n if (! chartType) return;\n\n // chart.update() doesn't work for series and labels\n // so we have to re-create the chart entirely\n if (chart) chart.destroy();\n\n createChart(chartType);\n }\n\n function createChart (type) {\n if (isResponsive(type, scope) && elem[0].clientHeight === 0 && container.clientHeight === 0) {\n return $timeout(function () {\n createChart(type);\n }, 50, false);\n }\n if (! scope.data || ! scope.data.length) return;\n scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour;\n scope.colours = getColours(type, scope);\n var cvs = elem[0], ctx = cvs.getContext('2d');\n var data = Array.isArray(scope.data[0]) ?\n getDataSets(scope.labels, scope.data, scope.series || [], scope.colours) :\n getData(scope.labels, scope.data, scope.colours);\n var options = angular.extend({}, ChartJs.getOptions(type), scope.options);\n chart = new ChartJs.Chart(ctx)[type](data, options);\n scope.$emit('create', chart);\n\n ['hover', 'click'].forEach(function (action) {\n if (scope[action])\n cvs[action === 'click' ? 'onclick' : 'onmousemove'] = getEventHandler(scope, chart, action);\n });\n if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);\n }\n\n function deprecated (attr) {\n if (typeof console !== 'undefined' && ChartJs.getOptions().env !== 'test') {\n var warn = typeof console.warn === 'function' ? console.warn : console.log;\n if (!! scope[attr]) {\n warn.call(console, '\"%s\" is deprecated and will be removed in a future version. ' +\n 'Please use \"chart-%s\" instead.', attr, attr);\n }\n }\n }\n }\n };\n };\n\n function canUpdateChart (newVal, oldVal) {\n if (newVal && oldVal && newVal.length && oldVal.length) {\n return Array.isArray(newVal[0]) ?\n newVal.length === oldVal.length && newVal.every(function (element, index) {\n return element.length === oldVal[index].length; }) :\n oldVal.reduce(sum, 0) > 0 ? newVal.length === oldVal.length : false;\n }\n return false;\n }\n\n function sum (carry, val) {\n return carry + val;\n }\n\n function getEventHandler (scope, chart, action) {\n return function (evt) {\n var atEvent = chart.getPointsAtEvent || chart.getBarsAtEvent || chart.getSegmentsAtEvent;\n if (atEvent) {\n var activePoints = atEvent.call(chart, evt);\n scope[action](activePoints, evt);\n scope.$apply();\n }\n };\n }\n\n function getColours (type, scope) {\n var colours = angular.copy(scope.colours ||\n ChartJs.getOptions(type).colours ||\n Chart.defaults.global.colours\n );\n while (colours.length < scope.data.length) {\n colours.push(scope.getColour());\n }\n return colours.map(convertColour);\n }\n\n function convertColour (colour) {\n if (typeof colour === 'object' && colour !== null) return colour;\n if (typeof colour === 'string' && colour[0] === '#') return getColour(hexToRgb(colour.substr(1)));\n return getRandomColour();\n }\n\n function getRandomColour () {\n var colour = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];\n return getColour(colour);\n }\n\n function getColour (colour) {\n return {\n fillColor: rgba(colour, 0.2),\n strokeColor: rgba(colour, 1),\n pointColor: rgba(colour, 1),\n pointStrokeColor: '#fff',\n pointHighlightFill: '#fff',\n pointHighlightStroke: rgba(colour, 0.8)\n };\n }\n\n function getRandomInt (min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n\n function rgba (colour, alpha) {\n if (usingExcanvas) {\n // rgba not supported by IE8\n return 'rgb(' + colour.join(',') + ')';\n } else {\n return 'rgba(' + colour.concat(alpha).join(',') + ')';\n }\n }\n\n // Credit: http://stackoverflow.com/a/11508164/1190235\n function hexToRgb (hex) {\n var bigint = parseInt(hex, 16),\n r = (bigint >> 16) & 255,\n g = (bigint >> 8) & 255,\n b = bigint & 255;\n\n return [r, g, b];\n }\n\n function getDataSets (labels, data, series, colours) {\n return {\n labels: labels,\n datasets: data.map(function (item, i) {\n return angular.extend({}, colours[i], {\n label: series[i],\n data: item\n });\n })\n };\n }\n\n function getData (labels, data, colours) {\n return labels.map(function (label, i) {\n return angular.extend({}, colours[i], {\n label: label,\n value: data[i],\n color: colours[i].strokeColor,\n highlight: colours[i].pointHighlightStroke\n });\n });\n }\n\n function setLegend (elem, chart) {\n var $parent = elem.parent(),\n $oldLegend = $parent.find('chart-legend'),\n legend = '' + chart.generateLegend() + '';\n if ($oldLegend.length) $oldLegend.replaceWith(legend);\n else $parent.append(legend);\n }\n\n function updateChart (chart, values, scope, elem) {\n if (Array.isArray(scope.data[0])) {\n chart.datasets.forEach(function (dataset, i) {\n (dataset.points || dataset.bars).forEach(function (dataItem, j) {\n dataItem.value = values[i][j];\n });\n });\n } else {\n chart.segments.forEach(function (segment, i) {\n segment.value = values[i];\n });\n }\n chart.update();\n scope.$emit('update', chart);\n if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);\n }\n\n function isEmpty (value) {\n return ! value ||\n (Array.isArray(value) && ! value.length) ||\n (typeof value === 'object' && ! Object.keys(value).length);\n }\n\n function isResponsive (type, scope) {\n var options = angular.extend({}, Chart.defaults.global, ChartJs.getOptions(type), scope.options);\n return options.responsive;\n }\n }\n}));\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/examples/charts.html b/examples/charts.html index 5e66514c..e7020bd8 100644 --- a/examples/charts.html +++ b/examples/charts.html @@ -62,7 +62,7 @@

Code on Github - Download (0.8.2) + Download (0.8.3)

diff --git a/package.json b/package.json index e8562952..8e3215cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-chart.js", - "version": "0.8.2", + "version": "0.8.3", "description": "An angular.js wrapper for Chart.js", "main": "dist/angular-chart.js", "directories": {