From: Evert Timberg Date: Sat, 2 May 2015 18:56:16 +0000 (-0400) Subject: Remove Math.sign X-Git-Tag: v2.0-alpha~27^2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2814c8e44c0fa545c3b8f49c2e7aa2a5dfdf932f;p=thirdparty%2FChart.js.git Remove Math.sign --- diff --git a/src/Chart.Bar.js b/src/Chart.Bar.js index 7147c1553..8f6651e2c 100644 --- a/src/Chart.Bar.js +++ b/src/Chart.Bar.js @@ -146,11 +146,11 @@ 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;