From 3cfe7b21d2b5b45f2de150c7313177dd5dbbd875 Mon Sep 17 00:00:00 2001 From: Jerome Touffe-Blin Date: Sat, 26 Mar 2016 18:27:54 -0700 Subject: [PATCH] Bump to `1.0.0-alpha3` as forgot to build the assets previously --- bower.json | 2 +- dist/angular-chart.js | 30 ++++++++++++++++++++++-------- dist/angular-chart.js.tar.gz | Bin 8621 -> 8874 bytes dist/angular-chart.min.js | 2 +- dist/angular-chart.min.js.map | 2 +- examples/charts.html | 30 +++++++++++++++++++++++++----- examples/charts.template.html | 12 ++++++------ package.json | 2 +- 8 files changed, 57 insertions(+), 23 deletions(-) diff --git a/bower.json b/bower.json index 7eeafc7b..1c6e7535 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-chart.js", - "version": "1.0.0-alpha2", + "version": "1.0.0-alpha3", "main": [ "./dist/angular-chart.js" ], diff --git a/dist/angular-chart.js b/dist/angular-chart.js index bb068b73..7d083a74 100644 --- a/dist/angular-chart.js +++ b/dist/angular-chart.js @@ -96,7 +96,8 @@ chartSeries: '=?', chartColors: '=?', chartClick: '=?', - chartHover: '=?' + chartHover: '=?', + chartYAxes: '=?' }, link: function (scope, elem/*, attrs */) { var chart; @@ -106,7 +107,10 @@ // Order of setting "watch" matter scope.$watch('chartData', function (newVal, oldVal) { - if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) return; + if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) { + destroyChart(chart, scope); + return; + } var chartType = type || scope.chartType; if (! chartType) return; @@ -128,7 +132,7 @@ }); scope.$on('$destroy', function () { - if (chart) chart.destroy(); + destroyChart(chart, scope); }); function resetChart (newVal, oldVal) { @@ -154,13 +158,14 @@ var colors = getColors(type, scope); var cvs = elem[0], ctx = cvs.getContext('2d'); var data = Array.isArray(scope.chartData[0]) ? - getDataSets(scope.chartLabels, scope.chartData, scope.chartSeries || [], colors) : + getDataSets(scope.chartLabels, scope.chartData, scope.chartSeries || [], colors, scope.chartYAxes) : getData(scope.chartLabels, scope.chartData, colors); var options = angular.extend({}, ChartJs.getOptions(type), scope.chartOptions); // Destroy old chart if it exists to avoid ghost charts issue // https://github.com/jtblin/angular-chart.js/issues/187 - if (chart) chart.destroy(); + destroyChart(chart, scope); + chart = new ChartJs.Chart(ctx, { type: type, data: data, @@ -199,7 +204,6 @@ if (triggerOnlyOnChange === false || angular.equals(lastState, activePoints) === false) { lastState = activePoints; scope[action](activePoints, evt); - scope.$apply(); } } }; @@ -265,14 +269,18 @@ return [r, g, b]; } - function getDataSets (labels, data, series, colors) { + function getDataSets (labels, data, series, colors, yaxis) { return { labels: labels, datasets: data.map(function (item, i) { - return angular.extend({}, colors[i], { + var dataset = angular.extend({}, colors[i], { label: series[i], data: item }); + if (yaxis) { + dataset.yAxisID = 'y-axis-' + (i + 1); + } + return dataset; }) }; } @@ -315,5 +323,11 @@ var options = angular.extend({}, Chart.defaults.global, ChartJs.getOptions(type), scope.chartOptions); return options.responsive; } + + function destroyChart(chart, scope) { + if(! chart) return; + chart.destroy(); + scope.$emit('chart-destroy', chart); + } } })); diff --git a/dist/angular-chart.js.tar.gz b/dist/angular-chart.js.tar.gz index 3e5ee18ea8daa79b0da3c75e350c90e4882d5d7b..458b7958ac8b070f38ee8669c9cbabb797e3336a 100644 GIT binary patch literal 8874 zcmV;bB30cViwFP!000021MNL)Q`^Y0=kxvwMZ1gbM9V7)31l70k_~YZ$4N+*WjWL> zVGG+}OO7lP2>8F>e#~e_FJlPFty{J17DzMQJw5%Jp7A*C`n~DU4gcu$-7s1{o&4tq z{H(67ZajHn;9vMj|6Si$f3|9@t#3Sgy7Bn&e@OyK>vS!!q0RPxgoG}50gwx z?*GY8`DE&MqCwyrt4IxcbE~O4EsFOrmhmiApcveQ;uwqsy@uoEYB4I0&PO zQLR>uQgD3g0SF@*#>$HEF6eqIPB0n;{_8zz90lF!&|8l23^7ufdJRL+b=ee+2S|77 zcfFH=?{!PYcHFaNgx;6w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RR&zre!(s*8j44^4CLe&;n$0uBz zzOiL#{6rcfW-UwDKMXxzB(sK0(* zkIfNd;t6kY&=TzN?p?ac0#yIEx#;y2dZvIwTLr>qejse(%sq}f12o@8*WsnH!SROz z@@HK3&Pcw>C*11U>kaGjb$W{eBY&Z6)qGaN#rmw7hB@CAFME`rqMf3r3~J+i;0A?` zS_FKN35**g%ve96ea!jQ;CT0fJo!tF;>(tGPD?RZH*7&|S}wONY4F&z$`N(VmT=Mw zK3AI~WMH>Brrg6_tEYLJ?6N>Xja&95F~47vMgR%WYLgQdihNB@y+3dYbWY>&DvLCR zv}+yIR$p^KrFB+pAkY}rC?h@>i#yH~kD2VV-Mb**=9;wMkXU4Fi(rA2SE8{fXIKR5 z5IBs+5(tanf%L}T$)gbP0(f}t>kZt(cJ_x%(Z^79EIJDD!=}tK_5T?qN|+jQ-E*`8gzUiK!c*URQq`T7VxRlhzO zKT*IwB9&Fa9y^bP4j-b3JrA}}6?+E#o-+2#_IDJrX95eAvS)4=s%0-gzrUEhAoO#p z+2;)QBg@(6&hJOnv(Fju#}>5D8T4mVw9gs($Cb3t8}R4Uv}bo-dHk5z$S!Lyy6#rj zo{?!E zq=*+Rc`tzQ<(P@O_X?jTk>x9MYu_{e{NneCp|5o*#>(HT4q5+RwPY8- zPxY$`_^B?f1b(V7Rs%oP8!v*N>W)>xPxZ#i;HP`FI{2whtq{KIn`v;1m%`U+t6KQd zY96W@ew6PpU#Irl0K6>Ki7zlI8Rhj$6)j zxw!@PGorRuQa>@rA74{HYrr2}R6nsOq#kFfE$8B;_4RH0y=v>H&O-8w>nqR)tgf#M z=RW22b^M2@ub(=8h*j7Zic0AzU1UFju2iWy(1q%D;i8)o*BpVvPg7sQkhA!@_o9h2K^RvwzA;{qytB&p$u^13&){AZc8i0FnRz2s`H5 diff --git a/dist/angular-chart.min.js b/dist/angular-chart.min.js index 399477cb..d258c768 100644 --- a/dist/angular-chart.min.js +++ b/dist/angular-chart.min.js @@ -1,2 +1,2 @@ -!function(t){"use strict";"object"==typeof exports?module.exports=t("undefined"!=typeof angular?angular:require("angular"),"undefined"!=typeof Chart?Chart:require("chart.js")):"function"==typeof define&&define.amd?define(["angular","chart"],t):t(angular,Chart)}(function(t,r){"use strict";function a(){var a={},n={Chart:r,getOptions:function(r){var n=r&&a[r]||{};return t.extend({},a,n)}};this.setOptions=function(r,n){return n?void(a[r]=t.extend(a[r]||{},n)):(n=r,void(a=t.extend(a,n)))},this.$get=function(){return n}}function n(a,n){function o(t,r){return t&&r&&t.length&&r.length?Array.isArray(t[0])?t.length===r.length&&t.every(function(t,a){return t.length===r[a].length}):r.reduce(c,0)>0?t.length===r.length:!1:!1}function c(t,r){return t+r}function i(r,a,n,e){var o=null;return function(c){var i=a.getElementsAtEvent||a.getPointsAtEvent;if(i){var u=i.call(a,c);e!==!1&&t.equals(o,u)!==!1||(o=u,r[n](u,c),r.$apply())}}}function u(n,e){for(var o=t.copy(e.chartColors||a.getOptions(n).chartColors||r.defaults.global.colors),c=o.length>16&255,n=r>>8&255,e=255&r;return[a,n,e]}function p(r,a,n,e){return{labels:r,datasets:a.map(function(r,a){return t.extend({},e[a],{label:n[a],data:r})})}}function C(t,r,a){return{labels:t,datasets:[{data:r,backgroundColor:a.map(function(t){return t.pointBackgroundColor}),hoverBackgroundColor:a.map(function(t){return t.backgroundColor})}]}}function v(t,r,a){Array.isArray(a.chartData[0])?t.data.datasets.forEach(function(t,a){t.data=r[a]}):t.data.datasets[0].data=r,t.update(),a.$emit("chart-update",t)}function y(t){return!t||Array.isArray(t)&&!t.length||"object"==typeof t&&!Object.keys(t).length}function b(n,e){var o=t.extend({},r.defaults.global,a.getOptions(n),e.chartOptions);return o.responsive}return function(r){return{restrict:"CA",scope:{chartGetColor:"=?",chartType:"=",chartData:"=?",chartLabels:"=?",chartOptions:"=?",chartSeries:"=?",chartColors:"=?",chartClick:"=?",chartHover:"=?"},link:function(c,l){function s(a,n){if(!y(a)&&!t.equals(a,n)){var e=r||c.chartType;e&&f(e)}}function f(r){if(b(r,c)&&0===l[0].clientHeight)return n(function(){f(r)},50,!1);if(c.chartData&&c.chartData.length){c.chartGetColor="function"==typeof c.chartGetColor?c.chartGetColor:h;var e=u(r,c),o=l[0],s=o.getContext("2d"),g=Array.isArray(c.chartData[0])?p(c.chartLabels,c.chartData,c.chartSeries||[],e):C(c.chartLabels,c.chartData,e),v=t.extend({},a.getOptions(r),c.chartOptions);d&&d.destroy(),d=new a.Chart(s,{type:r,data:g,options:v}),c.$emit("chart-create",d),o.onclick=c.chartClick?i(c,d,"chartClick",!1):t.noop,o.onmousemove=c.chartHover?i(c,d,"chartHover",!0):t.noop}}var d;e&&window.G_vmlCanvasManager.initElement(l[0]),c.$watch("chartData",function(t,a){if(t&&t.length&&(!Array.isArray(t[0])||t[0].length)){var n=r||c.chartType;if(n)return d&&o(t,a)?v(d,t,c):void f(n)}},!0),c.$watch("chartSeries",s,!0),c.$watch("chartLabels",s,!0),c.$watch("chartOptions",s,!0),c.$watch("chartColors",s,!0),c.$watch("chartType",function(r,a){y(r)||t.equals(r,a)||f(r)}),c.$on("$destroy",function(){d&&d.destroy()})}}}}r.defaults.global.multiTooltipTemplate="<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>",r.defaults.global.elements.line.borderWidth=2,r.defaults.global.elements.rectangle.borderWidth=2,r.defaults.global.colors=["#97BBCD","#DCDCDC","#F7464A","#46BFBD","#FDB45C","#949FB1","#4D5360"];var e="object"==typeof window.G_vmlCanvasManager&&null!==window.G_vmlCanvasManager&&"function"==typeof window.G_vmlCanvasManager.initElement;return e&&(r.defaults.global.animation=!1),t.module("chart.js",[]).provider("ChartJs",a).factory("ChartJsFactory",["ChartJs","$timeout",n]).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("undefined"!=typeof angular?angular:require("angular"),"undefined"!=typeof Chart?Chart:require("chart.js")):"function"==typeof define&&define.amd?define(["angular","chart"],t):t(angular,Chart)}(function(t,r){"use strict";function a(){var a={},e={Chart:r,getOptions:function(r){var e=r&&a[r]||{};return t.extend({},a,e)}};this.setOptions=function(r,e){return e?void(a[r]=t.extend(a[r]||{},e)):(e=r,void(a=t.extend(a,e)))},this.$get=function(){return e}}function e(a,e){function o(t,r){return t&&r&&t.length&&r.length?Array.isArray(t[0])?t.length===r.length&&t.every(function(t,a){return t.length===r[a].length}):r.reduce(c,0)>0?t.length===r.length:!1:!1}function c(t,r){return t+r}function i(r,a,e,n){var o=null;return function(c){var i=a.getElementsAtEvent||a.getPointsAtEvent;if(i){var u=i.call(a,c);n!==!1&&t.equals(o,u)!==!1||(o=u,r[e](u,c))}}}function u(e,n){for(var o=t.copy(n.chartColors||a.getOptions(e).chartColors||r.defaults.global.colors),c=o.length>16&255,e=r>>8&255,n=255&r;return[a,e,n]}function p(r,a,e,n,o){return{labels:r,datasets:a.map(function(r,a){var c=t.extend({},n[a],{label:e[a],data:r});return o&&(c.yAxisID="y-axis-"+(a+1)),c})}}function C(t,r,a){return{labels:t,datasets:[{data:r,backgroundColor:a.map(function(t){return t.pointBackgroundColor}),hoverBackgroundColor:a.map(function(t){return t.backgroundColor})}]}}function v(t,r,a){Array.isArray(a.chartData[0])?t.data.datasets.forEach(function(t,a){t.data=r[a]}):t.data.datasets[0].data=r,t.update(),a.$emit("chart-update",t)}function y(t){return!t||Array.isArray(t)&&!t.length||"object"==typeof t&&!Object.keys(t).length}function b(e,n){var o=t.extend({},r.defaults.global,a.getOptions(e),n.chartOptions);return o.responsive}function m(t,r){t&&(t.destroy(),r.$emit("chart-destroy",t))}return function(r){return{restrict:"CA",scope:{chartGetColor:"=?",chartType:"=",chartData:"=?",chartLabels:"=?",chartOptions:"=?",chartSeries:"=?",chartColors:"=?",chartClick:"=?",chartHover:"=?",chartYAxes:"=?"},link:function(c,l){function s(a,e){if(!y(a)&&!t.equals(a,e)){var n=r||c.chartType;n&&f(n)}}function f(r){if(b(r,c)&&0===l[0].clientHeight)return e(function(){f(r)},50,!1);if(c.chartData&&c.chartData.length){c.chartGetColor="function"==typeof c.chartGetColor?c.chartGetColor:h;var n=u(r,c),o=l[0],s=o.getContext("2d"),g=Array.isArray(c.chartData[0])?p(c.chartLabels,c.chartData,c.chartSeries||[],n,c.chartYAxes):C(c.chartLabels,c.chartData,n),v=t.extend({},a.getOptions(r),c.chartOptions);m(d,c),d=new a.Chart(s,{type:r,data:g,options:v}),c.$emit("chart-create",d),o.onclick=c.chartClick?i(c,d,"chartClick",!1):t.noop,o.onmousemove=c.chartHover?i(c,d,"chartHover",!0):t.noop}}var d;n&&window.G_vmlCanvasManager.initElement(l[0]),c.$watch("chartData",function(t,a){if(!t||!t.length||Array.isArray(t[0])&&!t[0].length)return void m(d,c);var e=r||c.chartType;if(e)return d&&o(t,a)?v(d,t,c):void f(e)},!0),c.$watch("chartSeries",s,!0),c.$watch("chartLabels",s,!0),c.$watch("chartOptions",s,!0),c.$watch("chartColors",s,!0),c.$watch("chartType",function(r,a){y(r)||t.equals(r,a)||f(r)}),c.$on("$destroy",function(){m(d,c)})}}}}r.defaults.global.multiTooltipTemplate="<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>",r.defaults.global.elements.line.borderWidth=2,r.defaults.global.elements.rectangle.borderWidth=2,r.defaults.global.colors=["#97BBCD","#DCDCDC","#F7464A","#46BFBD","#FDB45C","#949FB1","#4D5360"];var n="object"==typeof window.G_vmlCanvasManager&&null!==window.G_vmlCanvasManager&&"function"==typeof window.G_vmlCanvasManager.initElement;return n&&(r.defaults.global.animation=!1),t.module("chart.js",[]).provider("ChartJs",a).factory("ChartJsFactory",["ChartJs","$timeout",e]).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 diff --git a/dist/angular-chart.min.js.map b/dist/angular-chart.min.js.map index 68ee8401..6e0a6d85 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","exports","module","angular","require","Chart","define","amd","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","triggerOnlyOnChange","lastState","evt","atEvent","getElementsAtEvent","getPointsAtEvent","activePoints","call","equals","$apply","getColors","colors","copy","chartColors","defaults","global","notEnoughColors","chartData","push","chartGetColor","map","convertColor","color","getColor","hexToRgb","substr","getRandomColor","getRandomInt","backgroundColor","rgba","borderColor","pointBackgroundColor","pointBorderColor","pointHoverBackgroundColor","pointHoverBorderColor","min","max","Math","floor","random","alpha","usingExcanvas","join","concat","hex","bigint","parseInt","r","g","b","getDataSets","labels","data","series","datasets","item","i","label","getData","hoverBackgroundColor","updateChart","values","forEach","dataset","update","$emit","isEmpty","value","Object","keys","isResponsive","chartOptions","responsive","restrict","chartType","chartLabels","chartSeries","chartClick","chartHover","link","elem","resetChart","createChart","clientHeight","cvs","ctx","getContext","destroy","onclick","noop","onmousemove","window","G_vmlCanvasManager","initElement","$watch","$on","multiTooltipTemplate","elements","line","borderWidth","rectangle","animation","provider","directive"],"mappings":"C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AO,cAAeb,GAAY,GAExCpF,EAAMiG,OAAO,YAAa,SAAU9G,EAAQC,GACtCiF,EAAQlF,IACRnB,EAAQ2C,OAAOxB,EAAQC,IAC3BiG,EAAYlG,KAGda,EAAMkG,IAAI,WAAY,WAChBjG,GAAOA,EAAMyF,eAjH3BxH,EAAM+C,SAASC,OAAOiF,qBAAuB,6DAC7CjI,EAAM+C,SAASC,OAAOkF,SAASC,KAAKC,YAAc,EAClDpI,EAAM+C,SAASC,OAAOkF,SAASG,UAAUD,YAAc,EACvDpI,EAAM+C,SAASC,OAAOJ,QACpB,UACA,UACA,UACA,UACA,UACA,UACA,UAGF,IAAI8B,GAAqD,gBAA9BkD,QAAOC,oBACF,OAA9BD,OAAOC,oBAC0C,kBAA1CD,QAAOC,mBAAmBC,WAInC,OAFIpD,KAAe1E,EAAM+C,SAASC,OAAOsF,WAAY,GAE9CxI,EAAQD,OAAO,eACnB0I,SAAS,UAAWpI,GACpBR,QAAQ,kBAAmB,UAAW,WAAYmB,IAClD0H,UAAU,aAAc,iBAAkB,SAAU1H,GAAkB,MAAO,IAAIA,MACjF0H,UAAU,aAAc,iBAAkB,SAAU1H,GAAkB,MAAO,IAAIA,GAAe,WAChG0H,UAAU,YAAa,iBAAkB,SAAU1H,GAAkB,MAAO,IAAIA,GAAe,UAC/F0H,UAAU,cAAe,iBAAkB,SAAU1H,GAAkB,MAAO,IAAIA,GAAe,YACjG0H,UAAU,iBAAkB,iBAAkB,SAAU1H,GAAkB,MAAO,IAAIA,GAAe,eACpG0H,UAAU,YAAa,iBAAkB,SAAU1H,GAAkB,MAAO,IAAIA,GAAe,UAC/F0H,UAAU,kBAAmB,iBAAkB,SAAU1H,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(\n typeof angular !== 'undefined' ? angular : require('angular'),\n typeof Chart !== 'undefined' ? Chart : 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.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';\n Chart.defaults.global.elements.line.borderWidth = 2;\n Chart.defaults.global.elements.rectangle.borderWidth = 2;\n Chart.defaults.global.colors = [\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 chartGetColor: '=?',\n chartType: '=',\n chartData: '=?',\n chartLabels: '=?',\n chartOptions: '=?',\n chartSeries: '=?',\n chartColors: '=?',\n chartClick: '=?',\n chartHover: '=?'\n },\n link: function (scope, elem/*, attrs */) {\n var chart;\n\n if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);\n\n // Order of setting \"watch\" matter\n\n scope.$watch('chartData', 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 && canUpdateChart(newVal, oldVal))\n return updateChart(chart, newVal, scope);\n\n createChart(chartType);\n }, true);\n\n scope.$watch('chartSeries', resetChart, true);\n scope.$watch('chartLabels', resetChart, true);\n scope.$watch('chartOptions', resetChart, true);\n scope.$watch('chartColors', resetChart, true);\n\n scope.$watch('chartType', function (newVal, oldVal) {\n if (isEmpty(newVal)) return;\n if (angular.equals(newVal, oldVal)) return;\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 createChart(chartType);\n }\n\n function createChart (type) {\n // TODO: check parent?\n if (isResponsive(type, scope) && elem[0].clientHeight === 0) {\n return $timeout(function () {\n createChart(type);\n }, 50, false);\n }\n if (! scope.chartData || ! scope.chartData.length) return;\n scope.chartGetColor = typeof scope.chartGetColor === 'function' ? scope.chartGetColor : getRandomColor;\n var colors = getColors(type, scope);\n var cvs = elem[0], ctx = cvs.getContext('2d');\n var data = Array.isArray(scope.chartData[0]) ?\n getDataSets(scope.chartLabels, scope.chartData, scope.chartSeries || [], colors) :\n getData(scope.chartLabels, scope.chartData, colors);\n\n var options = angular.extend({}, ChartJs.getOptions(type), scope.chartOptions);\n // Destroy old chart if it exists to avoid ghost charts issue\n // https://github.com/jtblin/angular-chart.js/issues/187\n if (chart) chart.destroy();\n chart = new ChartJs.Chart(ctx, {\n type: type,\n data: data,\n options: options\n });\n scope.$emit('chart-create', chart);\n\n // Bind events\n cvs.onclick = scope.chartClick ? getEventHandler(scope, chart, 'chartClick', false) : angular.noop;\n cvs.onmousemove = scope.chartHover ? getEventHandler(scope, chart, 'chartHover', true) : angular.noop;\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, triggerOnlyOnChange) {\n var lastState = null;\n return function (evt) {\n var atEvent = chart.getElementsAtEvent || chart.getPointsAtEvent;\n if (atEvent) {\n var activePoints = atEvent.call(chart, evt);\n if (triggerOnlyOnChange === false || angular.equals(lastState, activePoints) === false) {\n lastState = activePoints;\n scope[action](activePoints, evt);\n scope.$apply();\n }\n }\n };\n }\n\n function getColors (type, scope) {\n var colors = angular.copy(scope.chartColors ||\n ChartJs.getOptions(type).chartColors ||\n Chart.defaults.global.colors\n );\n var notEnoughColors = colors.length < scope.chartData.length;\n while (colors.length < scope.chartData.length) {\n colors.push(scope.chartGetColor());\n }\n // mutate colors in this case as we don't want\n // the colors to change on each refresh\n if (notEnoughColors) scope.chartColors = colors;\n return colors.map(convertColor);\n }\n\n function convertColor (color) {\n if (typeof color === 'object' && color !== null) return color;\n if (typeof color === 'string' && color[0] === '#') return getColor(hexToRgb(color.substr(1)));\n return getRandomColor();\n }\n\n function getRandomColor () {\n var color = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];\n return getColor(color);\n }\n\n function getColor (color) {\n return {\n backgroundColor: rgba(color, 0.2),\n borderColor: rgba(color, 1),\n pointBackgroundColor: rgba(color, 1),\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: rgba(color, 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 (color, alpha) {\n if (usingExcanvas) {\n // rgba not supported by IE8\n return 'rgb(' + color.join(',') + ')';\n } else {\n return 'rgba(' + color.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, colors) {\n return {\n labels: labels,\n datasets: data.map(function (item, i) {\n return angular.extend({}, colors[i], {\n label: series[i],\n data: item\n });\n })\n };\n }\n\n function getData (labels, data, colors) {\n return {\n labels: labels,\n datasets: [{\n data: data,\n backgroundColor: colors.map(function (color) {\n return color.pointBackgroundColor;\n }),\n hoverBackgroundColor: colors.map(function (color) {\n return color.backgroundColor;\n })\n }]\n };\n }\n\n function updateChart (chart, values, scope) {\n if (Array.isArray(scope.chartData[0])) {\n chart.data.datasets.forEach(function (dataset, i) {\n dataset.data = values[i];\n });\n } else {\n chart.data.datasets[0].data = values;\n }\n\n chart.update();\n scope.$emit('chart-update', 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.chartOptions);\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","angular","require","Chart","define","amd","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","triggerOnlyOnChange","lastState","evt","atEvent","getElementsAtEvent","getPointsAtEvent","activePoints","call","equals","getColors","colors","copy","chartColors","defaults","global","notEnoughColors","chartData","push","chartGetColor","map","convertColor","color","getColor","hexToRgb","substr","getRandomColor","getRandomInt","backgroundColor","rgba","borderColor","pointBackgroundColor","pointBorderColor","pointHoverBackgroundColor","pointHoverBorderColor","min","max","Math","floor","random","alpha","usingExcanvas","join","concat","hex","bigint","parseInt","r","g","b","getDataSets","labels","data","series","yaxis","datasets","item","i","dataset","label","yAxisID","getData","hoverBackgroundColor","updateChart","values","forEach","update","$emit","isEmpty","value","Object","keys","isResponsive","chartOptions","responsive","destroyChart","destroy","restrict","chartType","chartLabels","chartSeries","chartClick","chartHover","chartYAxes","link","elem","resetChart","createChart","clientHeight","cvs","ctx","getContext","onclick","noop","onmousemove","window","G_vmlCanvasManager","initElement","$watch","$on","multiTooltipTemplate","elements","line","borderWidth","rectangle","animation","provider","directive"],"mappings":"CAAC,SAAUA,GACT,YACuB,iBAAZC,SAETC,OAAOD,QAAUD,EACI,mBAAZG,SAA0BA,QAAUC,QAAQ,WAClC,mBAAVC,OAAwBA,MAAQD,QAAQ,aACrB,kBAAXE,SAAyBA,OAAOC,IAEjDD,QAAQ,UAAW,SAAUN,GAG7BA,EAAQG,QAASE,Q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AAMoG,OAAO,YAAa,SAAUjH,EAAQC,GACtCkF,EAAQnF,IACRnB,EAAQ2C,OAAOxB,EAAQC,IAC3BqG,EAAYtG,KAGda,EAAMqG,IAAI,WAAY,WACpBxB,EAAa5E,EAAOD,QArH9B9B,EAAM8C,SAASC,OAAOqF,qBAAuB,6DAC7CpI,EAAM8C,SAASC,OAAOsF,SAASC,KAAKC,YAAc,EAClDvI,EAAM8C,SAASC,OAAOsF,SAASG,UAAUD,YAAc,EACvDvI,EAAM8C,SAASC,OAAOJ,QACpB,UACA,UACA,UACA,UACA,UACA,UACA,UAGF,IAAI8B,GAAqD,gBAA9BsD,QAAOC,oBACF,OAA9BD,OAAOC,oBAC0C,kBAA1CD,QAAOC,mBAAmBC,WAInC,OAFIxD,KAAezE,EAAM8C,SAASC,OAAO0F,WAAY,GAE9C3I,EAAQD,OAAO,eACnB6I,SAAS,UAAWvI,GACpBR,QAAQ,kBAAmB,UAAW,WAAYmB,IAClD6H,UAAU,aAAc,iBAAkB,SAAU7H,GAAkB,MAAO,IAAIA,MACjF6H,UAAU,aAAc,iBAAkB,SAAU7H,GAAkB,MAAO,IAAIA,GAAe,WAChG6H,UAAU,YAAa,iBAAkB,SAAU7H,GAAkB,MAAO,IAAIA,GAAe,UAC/F6H,UAAU,cAAe,iBAAkB,SAAU7H,GAAkB,MAAO,IAAIA,GAAe,YACjG6H,UAAU,iBAAkB,iBAAkB,SAAU7H,GAAkB,MAAO,IAAIA,GAAe,eACpG6H,UAAU,YAAa,iBAAkB,SAAU7H,GAAkB,MAAO,IAAIA,GAAe,UAC/F6H,UAAU,kBAAmB,iBAAkB,SAAU7H,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(\n typeof angular !== 'undefined' ? angular : require('angular'),\n typeof Chart !== 'undefined' ? Chart : 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.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';\n Chart.defaults.global.elements.line.borderWidth = 2;\n Chart.defaults.global.elements.rectangle.borderWidth = 2;\n Chart.defaults.global.colors = [\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 chartGetColor: '=?',\n chartType: '=',\n chartData: '=?',\n chartLabels: '=?',\n chartOptions: '=?',\n chartSeries: '=?',\n chartColors: '=?',\n chartClick: '=?',\n chartHover: '=?',\n chartYAxes: '=?'\n },\n link: function (scope, elem/*, attrs */) {\n var chart;\n\n if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);\n\n // Order of setting \"watch\" matter\n\n scope.$watch('chartData', function (newVal, oldVal) {\n if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) {\n destroyChart(chart, scope);\n return;\n }\n var chartType = type || scope.chartType;\n if (! chartType) return;\n\n if (chart && canUpdateChart(newVal, oldVal))\n return updateChart(chart, newVal, scope);\n\n createChart(chartType);\n }, true);\n\n scope.$watch('chartSeries', resetChart, true);\n scope.$watch('chartLabels', resetChart, true);\n scope.$watch('chartOptions', resetChart, true);\n scope.$watch('chartColors', resetChart, true);\n\n scope.$watch('chartType', function (newVal, oldVal) {\n if (isEmpty(newVal)) return;\n if (angular.equals(newVal, oldVal)) return;\n createChart(newVal);\n });\n\n scope.$on('$destroy', function () {\n destroyChart(chart, scope);\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 createChart(chartType);\n }\n\n function createChart (type) {\n // TODO: check parent?\n if (isResponsive(type, scope) && elem[0].clientHeight === 0) {\n return $timeout(function () {\n createChart(type);\n }, 50, false);\n }\n if (! scope.chartData || ! scope.chartData.length) return;\n scope.chartGetColor = typeof scope.chartGetColor === 'function' ? scope.chartGetColor : getRandomColor;\n var colors = getColors(type, scope);\n var cvs = elem[0], ctx = cvs.getContext('2d');\n var data = Array.isArray(scope.chartData[0]) ?\n getDataSets(scope.chartLabels, scope.chartData, scope.chartSeries || [], colors, scope.chartYAxes) :\n getData(scope.chartLabels, scope.chartData, colors);\n\n var options = angular.extend({}, ChartJs.getOptions(type), scope.chartOptions);\n // Destroy old chart if it exists to avoid ghost charts issue\n // https://github.com/jtblin/angular-chart.js/issues/187\n destroyChart(chart, scope);\n\n chart = new ChartJs.Chart(ctx, {\n type: type,\n data: data,\n options: options\n });\n scope.$emit('chart-create', chart);\n\n // Bind events\n cvs.onclick = scope.chartClick ? getEventHandler(scope, chart, 'chartClick', false) : angular.noop;\n cvs.onmousemove = scope.chartHover ? getEventHandler(scope, chart, 'chartHover', true) : angular.noop;\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, triggerOnlyOnChange) {\n var lastState = null;\n return function (evt) {\n var atEvent = chart.getElementsAtEvent || chart.getPointsAtEvent;\n if (atEvent) {\n var activePoints = atEvent.call(chart, evt);\n if (triggerOnlyOnChange === false || angular.equals(lastState, activePoints) === false) {\n lastState = activePoints;\n scope[action](activePoints, evt);\n }\n }\n };\n }\n\n function getColors (type, scope) {\n var colors = angular.copy(scope.chartColors ||\n ChartJs.getOptions(type).chartColors ||\n Chart.defaults.global.colors\n );\n var notEnoughColors = colors.length < scope.chartData.length;\n while (colors.length < scope.chartData.length) {\n colors.push(scope.chartGetColor());\n }\n // mutate colors in this case as we don't want\n // the colors to change on each refresh\n if (notEnoughColors) scope.chartColors = colors;\n return colors.map(convertColor);\n }\n\n function convertColor (color) {\n if (typeof color === 'object' && color !== null) return color;\n if (typeof color === 'string' && color[0] === '#') return getColor(hexToRgb(color.substr(1)));\n return getRandomColor();\n }\n\n function getRandomColor () {\n var color = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];\n return getColor(color);\n }\n\n function getColor (color) {\n return {\n backgroundColor: rgba(color, 0.2),\n borderColor: rgba(color, 1),\n pointBackgroundColor: rgba(color, 1),\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: rgba(color, 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 (color, alpha) {\n if (usingExcanvas) {\n // rgba not supported by IE8\n return 'rgb(' + color.join(',') + ')';\n } else {\n return 'rgba(' + color.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, colors, yaxis) {\n return {\n labels: labels,\n datasets: data.map(function (item, i) {\n var dataset = angular.extend({}, colors[i], {\n label: series[i],\n data: item\n });\n if (yaxis) {\n dataset.yAxisID = 'y-axis-' + (i + 1);\n }\n return dataset;\n })\n };\n }\n\n function getData (labels, data, colors) {\n return {\n labels: labels,\n datasets: [{\n data: data,\n backgroundColor: colors.map(function (color) {\n return color.pointBackgroundColor;\n }),\n hoverBackgroundColor: colors.map(function (color) {\n return color.backgroundColor;\n })\n }]\n };\n }\n\n function updateChart (chart, values, scope) {\n if (Array.isArray(scope.chartData[0])) {\n chart.data.datasets.forEach(function (dataset, i) {\n dataset.data = values[i];\n });\n } else {\n chart.data.datasets[0].data = values;\n }\n\n chart.update();\n scope.$emit('chart-update', 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.chartOptions);\n return options.responsive;\n }\n\n function destroyChart(chart, scope) {\n if(! chart) return;\n chart.destroy();\n scope.$emit('chart-destroy', chart);\n }\n }\n}));\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/examples/charts.html b/examples/charts.html index 95efff1d..d021dd13 100644 --- a/examples/charts.html +++ b/examples/charts.html @@ -61,7 +61,7 @@

Code on Github - Download (1.0.0-alpha1) + Download (1.0.0-alpha3)

@@ -126,7 +126,7 @@

Directives

Line Chart
+ chart-click="onClick" chart-hover="onHover" chart-series="series" chart-options="options" chart-y-axes="multiAxis">
@@ -143,13 +143,14 @@

Directives

  • chart-click (optional): onclick event handler
  • chart-hover (optional): onmousemove event handler
  • chart-colors (default to global colors): colors for the chart
  • +
  • chart-y-axes (optional): if true add multiple axis, required: ids y-axis-{n} in the options (view Javascript)
  • -
    <canvas id="line" class="chart chart-line" chart-data="data"
    -  chart-labels="labels" chart-series="series"
    -  chart-click="onClick" >
    +            
    <canvas id="line" class="chart chart-line" chart-data="data"
    +chart-labels="labels" chart-series="series" chart-options="options"
    +chart-y-axes="true" chart-click="onClick"
     </canvas> 
    @@ -164,6 +165,24 @@

    Directives

    $scope.onClick = function (points, evt) { console.log(points, evt); }; + $scope.options = { + scales: { + yAxes: [ + { + id: 'y-axis-1', + type: 'linear', + display: true, + position: 'left' + }, + { + id: 'y-axis-2', + type: 'linear', + display: true, + position: 'right' + } + ] + } + }; });
    @@ -184,6 +203,7 @@

    Directives

  • chart-click (optional): onclick event handler
  • chart-hover (optional): onmousemove event handler
  • chart-colors (default to global colors): colors for the chart
  • +
  • chart-y-axes (optional): if true add multiple axis, required:: ids y-axis-{n} in the options
  • diff --git a/examples/charts.template.html b/examples/charts.template.html index bc0802ac..0e455cc2 100644 --- a/examples/charts.template.html +++ b/examples/charts.template.html @@ -169,16 +169,16 @@

    Directives

    scales: { yAxes: [ { - id: "y-axis-1", - type: "linear", + id: 'y-axis-1', + type: 'linear', display: true, - position: "left" + position: 'left' }, { - id: "y-axis-2", - type: "linear", + id: 'y-axis-2', + type: 'linear', display: true, - position: "right" + position: 'right' } ] } diff --git a/package.json b/package.json index ea3db4b7..490c21f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-chart.js", - "version": "1.0.0-alpha2", + "version": "1.0.0-alpha3", "description": "An angular.js wrapper for Chart.js", "main": "dist/angular-chart.js", "directories": {