From: Tore Lervik Date: Fri, 25 Dec 2015 12:53:09 +0000 (+0100) Subject: min/max should have precedence over suggestedMin/suggestedMax X-Git-Tag: 2.0.0-beta2~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1832%2Fhead;p=thirdparty%2FChart.js.git min/max should have precedence over suggestedMin/suggestedMax --- diff --git a/src/scales/scale.linear.js b/src/scales/scale.linear.js index 68cbf2e0f..3adfd8bd5 100644 --- a/src/scales/scale.linear.js +++ b/src/scales/scale.linear.js @@ -129,16 +129,16 @@ } } - if (this.options.ticks.suggestedMin !== undefined) { - this.min = Math.min(this.min, this.options.ticks.suggestedMin); - } else if (this.options.ticks.min !== undefined) { + if (this.options.ticks.min !== undefined) { this.min = this.options.ticks.min; + } else if (this.options.ticks.suggestedMin !== undefined) { + this.min = Math.min(this.min, this.options.ticks.suggestedMin); } - if (this.options.ticks.suggestedMax !== undefined) { - this.max = Math.max(this.max, this.options.ticks.suggestedMax); - } else if (this.options.ticks.max !== undefined) { + if (this.options.ticks.max !== undefined) { this.max = this.options.ticks.max; + } else if (this.options.ticks.suggestedMax !== undefined) { + this.max = Math.max(this.max, this.options.ticks.suggestedMax); } if (this.min === this.max) {