diff --git a/HISTORY.md b/HISTORY.md index 49e09d02..107647df 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,13 @@ http://visjs.org +## not-yet-released, version 4.15.1 + +### Graph2d + +- Fixed #1692: Error when y-axis values are equal. + + ## 2016-02-23, version 4.15.0 ### Timeline diff --git a/lib/timeline/component/DataScale.js b/lib/timeline/component/DataScale.js index 5065f0e3..a87477fb 100644 --- a/lib/timeline/component/DataScale.js +++ b/lib/timeline/component/DataScale.js @@ -59,7 +59,9 @@ DataScale.prototype.determineScale = function () { var range = this._end - this._start; this.scale = this.containerHeight / range; var minimumStepValue = this.majorCharHeight / this.scale; - var orderOfMagnitude = Math.round(Math.log(range) / Math.LN10); + var orderOfMagnitude = (range > 0) + ? Math.round(Math.log(range) / Math.LN10) + : 0; this.minorStepIdx = -1; this.magnitudefactor = Math.pow(10, orderOfMagnitude);