mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
Fixes #71.
This commit is contained in:
parent
eacbc01149
commit
8d7522a2f0
@ -144,12 +144,20 @@ class Morris.Line
|
|||||||
@ymax = Math.max parseInt(@options.ymax[5..], 10), ymax
|
@ymax = Math.max parseInt(@options.ymax[5..], 10), ymax
|
||||||
else
|
else
|
||||||
@ymax = ymax
|
@ymax = ymax
|
||||||
|
else if typeof @options.ymax is 'string'
|
||||||
|
@ymax = parseInt(@options.ymax, 10)
|
||||||
|
else
|
||||||
|
@ymax = @options.ymax
|
||||||
if typeof @options.ymin is 'string' and @options.ymin[0..3] is 'auto'
|
if typeof @options.ymin is 'string' and @options.ymin[0..3] is 'auto'
|
||||||
ymin = Math.min.apply null, Array.prototype.concat.apply([], @series)
|
ymin = Math.min.apply null, Array.prototype.concat.apply([], @series)
|
||||||
if @options.ymin.length > 5
|
if @options.ymin.length > 5
|
||||||
@ymin = Math.min parseInt(@options.ymin[5..], 10), ymin
|
@ymin = Math.min parseInt(@options.ymin[5..], 10), ymin
|
||||||
else
|
else
|
||||||
@ymin = ymin
|
@ymin = ymin
|
||||||
|
else if typeof @options.ymin is 'string'
|
||||||
|
@ymin = parseInt(@options.ymin, 10)
|
||||||
|
else
|
||||||
|
@ymin = @options.ymin
|
||||||
if @ymin is @ymax
|
if @ymin is @ymax
|
||||||
@ymin -= 1
|
@ymin -= 1
|
||||||
@ymax += 1
|
@ymax += 1
|
||||||
|
@ -175,6 +175,10 @@
|
|||||||
} else {
|
} else {
|
||||||
this.ymax = ymax;
|
this.ymax = ymax;
|
||||||
}
|
}
|
||||||
|
} else if (typeof this.options.ymax === 'string') {
|
||||||
|
this.ymax = parseInt(this.options.ymax, 10);
|
||||||
|
} else {
|
||||||
|
this.ymax = this.options.ymax;
|
||||||
}
|
}
|
||||||
if (typeof this.options.ymin === 'string' && this.options.ymin.slice(0, 4) === 'auto') {
|
if (typeof this.options.ymin === 'string' && this.options.ymin.slice(0, 4) === 'auto') {
|
||||||
ymin = Math.min.apply(null, Array.prototype.concat.apply([], this.series));
|
ymin = Math.min.apply(null, Array.prototype.concat.apply([], this.series));
|
||||||
@ -183,6 +187,10 @@
|
|||||||
} else {
|
} else {
|
||||||
this.ymin = ymin;
|
this.ymin = ymin;
|
||||||
}
|
}
|
||||||
|
} else if (typeof this.options.ymin === 'string') {
|
||||||
|
this.ymin = parseInt(this.options.ymin, 10);
|
||||||
|
} else {
|
||||||
|
this.ymin = this.options.ymin;
|
||||||
}
|
}
|
||||||
if (this.ymin === this.ymax) {
|
if (this.ymin === this.ymax) {
|
||||||
this.ymin -= 1;
|
this.ymin -= 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