Browse Source

Fixed #1692: Error when y-axis values are equal

codeClimate
jos 8 years ago
parent
commit
c1dd63574f
2 changed files with 10 additions and 1 deletions
  1. +7
    -0
      HISTORY.md
  2. +3
    -1
      lib/timeline/component/DataScale.js

+ 7
- 0
HISTORY.md View File

@ -2,6 +2,13 @@
http://visjs.org 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 ## 2016-02-23, version 4.15.0
### Timeline ### Timeline

+ 3
- 1
lib/timeline/component/DataScale.js View File

@ -59,7 +59,9 @@ DataScale.prototype.determineScale = function () {
var range = this._end - this._start; var range = this._end - this._start;
this.scale = this.containerHeight / range; this.scale = this.containerHeight / range;
var minimumStepValue = this.majorCharHeight / this.scale; 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.minorStepIdx = -1;
this.magnitudefactor = Math.pow(10, orderOfMagnitude); this.magnitudefactor = Math.pow(10, orderOfMagnitude);

Loading…
Cancel
Save