Skip to content

Commit 090db94

Browse files
committed
fix(graph): fix for when data min/max delta is zero and negative and grid y min/max is auto, fixes grafana#6980
1 parent 3be77ad commit 090db94

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

public/vendor/flot/jquery.flot.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,14 +1663,16 @@ Licensed under the MIT license.
16631663
// Grafana fix: wide Y min and max using increased wideFactor
16641664
// when all series values are the same
16651665
var wideFactor = 0.25;
1666-
var widen = max == 0 ? 1 : max * wideFactor;
1666+
var widen = Math.abs(max == 0 ? 1 : max * wideFactor);
16671667

1668-
if (opts.min == null)
1669-
min -= widen;
1668+
if (opts.min == null) {
1669+
min -= widen;
1670+
}
16701671
// always widen max if we couldn't widen min to ensure we
16711672
// don't fall into min == max which doesn't work
1672-
if (opts.max == null || opts.min != null)
1673-
max += widen;
1673+
if (opts.max == null || opts.min != null) {
1674+
max += widen;
1675+
}
16741676
}
16751677
else {
16761678
// consider autoscaling

0 commit comments

Comments
 (0)