From: Internalfx Date: Wed, 19 Aug 2015 01:39:11 +0000 (-0700) Subject: Closes #1309 X-Git-Tag: v1.1.0~58^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1390%2Fhead;p=thirdparty%2FChart.js.git Closes #1309 Doughnut.addData() broken for index of 0 #1309 --- diff --git a/src/Chart.Doughnut.js b/src/Chart.Doughnut.js index 12e9f2255..e63bf9e50 100644 --- a/src/Chart.Doughnut.js +++ b/src/Chart.Doughnut.js @@ -91,7 +91,7 @@ return segmentsArray; }, addData : function(segment, atIndex, silent){ - var index = atIndex || this.segments.length; + var index = atIndex !== undefined ? atIndex : this.segments.length; this.segments.splice(index, 0, new this.SegmentArc({ value : segment.value, outerRadius : (this.options.animateScale) ? 0 : this.outerRadius,