Skip to content

Commit e949eda

Browse files
committed
Update the pie chart to use the default color/highlight if none is specified
1 parent a868a2f commit e949eda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Chart.Doughnut.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@
9292
},
9393
addData : function(segment, atIndex, silent){
9494
var index = atIndex !== undefined ? atIndex : this.segments.length;
95+
if ( typeof(segment.color) === "undefined" ) {
96+
segment.color = Chart.defaults.global.segmentColorDefault[index];
97+
segment.highlight = Chart.defaults.global.segmentHighlightColorDefaults[index];
98+
}
9599
this.segments.splice(index, 0, new this.SegmentArc({
96100
value : segment.value,
97101
outerRadius : (this.options.animateScale) ? 0 : this.outerRadius,

0 commit comments

Comments
 (0)