mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 09:28:51 +00:00
Fix: 0 is falsy, so need to check differently if there is value defined.
This commit is contained in:
parent
1ac3119648
commit
08676a3d0b
@ -140,7 +140,7 @@
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
function seriesMinValue(series) {
|
||||
return _.min(_.map(series, function(s) { return _.min(series.y) }));
|
||||
}
|
||||
@ -304,7 +304,7 @@
|
||||
scope.layout.yaxis = {title: getTitle(scope.options.yAxis[0]),
|
||||
type: getScaleType(scope.options.yAxis[0].type)};
|
||||
|
||||
if (scope.options.yAxis[0].rangeMin || scope.options.yAxis[0].rangeMax) {
|
||||
if (angular.isNumber(scope.options.yAxis[0].rangeMin) || angular.isNumber(scope.options.yAxis[0].rangeMax)) {
|
||||
var min = scope.options.yAxis[0].rangeMin || Math.min(0, seriesMinValue(leftAxisSeries(scope.data)));
|
||||
var max = scope.options.yAxis[0].rangeMax || seriesMaxValue(leftAxisSeries(scope.data));
|
||||
|
||||
@ -317,7 +317,7 @@
|
||||
overlaying: 'y',
|
||||
side: 'right'};
|
||||
|
||||
if (scope.options.yAxis[1].rangeMin || scope.options.yAxis[0].rangeMax) {
|
||||
if (angular.isNumber(scope.options.yAxis[1].rangeMin) || angular.isNumber(scope.options.yAxis[1].rangeMax)) {
|
||||
var min = scope.options.yAxis[1].rangeMin || Math.min(0, seriesMinValue(rightAxisSeries(scope.data)));
|
||||
var max = scope.options.yAxis[1].rangeMax || seriesMaxValue(rightAxisSeries(scope.data));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user