From: Christopher Weiss Date: Fri, 30 Jan 2015 16:01:44 +0000 (-0500) Subject: Using helper.each instead of Array.prototype.map X-Git-Tag: v2.0-alpha~47^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8b7c85c5e11a713a8773f432c4028c2e06a8a8b;p=thirdparty%2FChart.js.git Using helper.each instead of Array.prototype.map --- diff --git a/src/Chart.Doughnut.js b/src/Chart.Doughnut.js index ae2ce937e..8e60879a0 100644 --- a/src/Chart.Doughnut.js +++ b/src/Chart.Doughnut.js @@ -79,6 +79,9 @@ }); helpers.each(data,function(datapoint, index){ + if (!datapoint.color) { + datapoint.color = 'hsl(' + (360 * index / data.length) + ', 100%, 50%)'; + } this.addData(datapoint, index, true); },this);