-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Description
getData or getDataSeries loops through an array of colors with a possible array out of range exception(when data.length is > than scope.colours.length(or default colors length).
A possible (but ugly fix might be):
//Prevent an undefined compilation error
colours: '=?',
//Remove colour array assignment in getdata and getdata series
function createChart()
scope.colours = scope.colours || Chart.defaults.global.colours;
if(scope.colours.length < scope.data.length)
{
var itemsToAdd = scope.data.length - scope.colours.length;
for(var i=0; i<=itemsToAdd; i++)
{
var color = getRandomColor();
scope.colours.push({
fillColor: color,
strokeColor: color,
pointColor: color,
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(151,187,205,0.8)"
});
}
}
getRandomColor() is a matter of a flavour.
Cheers!