From: etimberg Date: Wed, 28 Oct 2015 00:04:21 +0000 (-0400) Subject: Scale expansion if min === max will only occur after ticks.beginAtZero is handled X-Git-Tag: 2.0.0-beta1~37^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1581%2Fhead;p=thirdparty%2FChart.js.git Scale expansion if min === max will only occur after ticks.beginAtZero is handled --- diff --git a/src/scales/scale.linear.js b/src/scales/scale.linear.js index bacf69934..78c02a2ea 100644 --- a/src/scales/scale.linear.js +++ b/src/scales/scale.linear.js @@ -100,12 +100,6 @@ }, this); } - if (this.min === this.max) { - this.min--; - this.max++; - } - - // Then calulate the ticks this.ticks = []; @@ -144,6 +138,11 @@ // move the botttom down to 0 this.min = 0; } + } + + if (this.min === this.max) { + this.min--; + this.max++; } var niceRange = helpers.niceNum(this.max - this.min, false);