]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Remove Math.sign
authorEvert Timberg <evert.timberg@gmail.com>
Sat, 2 May 2015 18:56:16 +0000 (14:56 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Sat, 2 May 2015 18:56:16 +0000 (14:56 -0400)
src/Chart.Bar.js

index 7147c15534fab4b100f111ebe7dc204dba59c735..8f6651e2cf35b70d97b2fd2437bea64a92f3b086 100644 (file)
                calculateBarBase: function() {
                        var base = this.scale.endPoint;
                        
-                       if (this.scale.beginAtZero || Math.sign(this.scale.min) != Math.sign(this.scale.max))
+                       if (this.scale.beginAtZero || ((this.scale.min < 0 && this.scale.max > 0) || (this.scale.min > 0 && this.scale.max < 0)))
                        {
                                base = this.scale.calculateY(0);
                        }
-                       else if (Math.sign(this.scale.min) < 0 && Math.sign(this.scale.max) < 0)
+                       else if (this.scale.min < 0 && this.scale.max < 0)
                        {
                                // All values are negative. Use the top as the base
                                base = this.scale.startPoint;