X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=public%2Fbower_components%2Fangular-chart.js%2Fangular-chart.js;h=83750817c56cb60eb92b37054f69f12f6e2a5163;hb=221ba7c2ffc043570bbad1e8f0d6074fb4ff1fb0;hp=c28f2678d648eeaf47692560cea022274f125150;hpb=5d92478b1cb7479f39a43973775a6f6147fba8ac;p=motion.git diff --git a/public/bower_components/angular-chart.js/angular-chart.js b/public/bower_components/angular-chart.js/angular-chart.js index c28f267..8375081 100644 --- a/public/bower_components/angular-chart.js/angular-chart.js +++ b/public/bower_components/angular-chart.js/angular-chart.js @@ -2,9 +2,7 @@ 'use strict'; if (typeof exports === 'object') { // Node/CommonJS - module.exports = factory( - typeof angular !== 'undefined' ? angular : require('angular'), - typeof Chart !== 'undefined' ? Chart : require('chart.js')); + module.exports = factory(typeof angular ? angular : require('angular'), require('chart.js')); } else if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['angular', 'chart'], factory); @@ -186,11 +184,11 @@ } if (! scope.data || ! scope.data.length) return; scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour; - var colours = getColours(type, scope); + scope.colours = getColours(type, scope); var cvs = elem[0], ctx = cvs.getContext('2d'); var data = Array.isArray(scope.data[0]) ? - getDataSets(scope.labels, scope.data, scope.series || [], colours) : - getData(scope.labels, scope.data, colours); + getDataSets(scope.labels, scope.data, scope.series || [], scope.colours) : + getData(scope.labels, scope.data, scope.colours); var options = angular.extend({}, ChartJs.getOptions(type), scope.options); chart = new ChartJs.Chart(ctx)[type](data, options); scope.$emit('create', chart); @@ -245,18 +243,13 @@ } function getColours (type, scope) { - var notEnoughColours = false; var colours = angular.copy(scope.colours || ChartJs.getOptions(type).colours || Chart.defaults.global.colours ); while (colours.length < scope.data.length) { colours.push(scope.getColour()); - notEnoughColours = true; } - // mutate colours in this case as we don't want - // the colours to change on each refresh - if (notEnoughColours) scope.colours = colours; return colours.map(convertColour); }