From: Damian Silbergleith Cunniff Date: Sat, 26 Dec 2015 16:13:33 +0000 (-0700) Subject: Update the pie chart to use the default color/highlight if none is specified X-Git-Tag: v1.1.0~24^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e949edacf5fea379e3bc555fd3812823c139d4b4;p=thirdparty%2FChart.js.git Update the pie chart to use the default color/highlight if none is specified --- diff --git a/src/Chart.Doughnut.js b/src/Chart.Doughnut.js index e63bf9e50..0073f9e8a 100644 --- a/src/Chart.Doughnut.js +++ b/src/Chart.Doughnut.js @@ -92,6 +92,10 @@ }, addData : function(segment, atIndex, silent){ var index = atIndex !== undefined ? atIndex : this.segments.length; + if ( typeof(segment.color) === "undefined" ) { + segment.color = Chart.defaults.global.segmentColorDefault[index]; + segment.highlight = Chart.defaults.global.segmentHighlightColorDefaults[index]; + } this.segments.splice(index, 0, new this.SegmentArc({ value : segment.value, outerRadius : (this.options.animateScale) ? 0 : this.outerRadius,