]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Using helper.each instead of Array.prototype.map
authorChristopher Weiss <cmweiss@gmail.com>
Fri, 30 Jan 2015 16:01:44 +0000 (11:01 -0500)
committerChristopher Weiss <cmweiss@gmail.com>
Fri, 30 Jan 2015 16:01:44 +0000 (11:01 -0500)
src/Chart.Doughnut.js

index ae2ce937e1cd89c8542f91700a498218008878ed..8e60879a0e576f7f36e4c04606b4812b73c8fdc8 100644 (file)
@@ -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);