From 2e0211320bbff4bc81e40062a4c4815cca256e2d Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Tue, 27 Jan 2015 18:31:03 -0500 Subject: [PATCH] Fix a divide by 0 error when there is only 1 label --- src/Chart.Core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Chart.Core.js b/src/Chart.Core.js index 7cea99535..eb34c871c 100755 --- a/src/Chart.Core.js +++ b/src/Chart.Core.js @@ -1575,7 +1575,7 @@ var isRotated = (this.xLabelRotation > 0), // innerWidth = (this.offsetGridLines) ? this.width - offsetLeft - this.padding : this.width - (offsetLeft + halfLabelWidth * 2) - this.padding, innerWidth = this.width - (this.xScalePaddingLeft + this.xScalePaddingRight), - valueWidth = innerWidth/(this.valuesCount - ((this.offsetGridLines) ? 0 : 1)), + valueWidth = innerWidth/Math.max((this.valuesCount - ((this.offsetGridLines) ? 0 : 1)), 1), valueOffset = (valueWidth * index) + this.xScalePaddingLeft; if (this.offsetGridLines){ -- 2.47.2