mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
Don't go negative on ymin if ymin==ymax==0 (fix #80).
This commit is contained in:
parent
088233d8d2
commit
e0b406feee
@ -153,7 +153,7 @@ class Morris.Line
|
|||||||
else
|
else
|
||||||
@ymin = @options.ymin
|
@ymin = @options.ymin
|
||||||
if @ymin is @ymax
|
if @ymin is @ymax
|
||||||
@ymin -= 1
|
if @ymin is not 0 then @ymin -= 1
|
||||||
@ymax += 1
|
@ymax += 1
|
||||||
|
|
||||||
@yInterval = (@ymax - @ymin) / (@options.numLines - 1)
|
@yInterval = (@ymax - @ymin) / (@options.numLines - 1)
|
||||||
|
@ -464,7 +464,9 @@
|
|||||||
this.ymin = this.options.ymin;
|
this.ymin = this.options.ymin;
|
||||||
}
|
}
|
||||||
if (this.ymin === this.ymax) {
|
if (this.ymin === this.ymax) {
|
||||||
this.ymin -= 1;
|
if (this.ymin === !0) {
|
||||||
|
this.ymin -= 1;
|
||||||
|
}
|
||||||
this.ymax += 1;
|
this.ymax += 1;
|
||||||
}
|
}
|
||||||
this.yInterval = (this.ymax - this.ymin) / (this.options.numLines - 1);
|
this.yInterval = (this.ymax - this.ymin) / (this.options.numLines - 1);
|
||||||
|
2
morris.min.js
vendored
2
morris.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user