]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
min/max should have precedence over suggestedMin/suggestedMax 1832/head
authorTore Lervik <tore@lervik.com>
Fri, 25 Dec 2015 12:53:09 +0000 (13:53 +0100)
committerTore Lervik <tore@lervik.com>
Fri, 25 Dec 2015 12:53:09 +0000 (13:53 +0100)
src/scales/scale.linear.js

index 68cbf2e0f96356fe0c2570cdcdad3fb6a971039e..3adfd8bd585dc007b43c7f79284a507c47f3f6df 100644 (file)
                                }
                        }
 
-                       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) {