fix(graph): increase Y min and max range when series values are the same, (#6082)

fixes #6070, #6050.
This commit is contained in:
Alexander Zobnin 2016-09-20 12:38:18 +03:00 committed by Torkel Ödegaard
parent e926b01185
commit 20f7eee8cc

View File

@ -1663,8 +1663,10 @@ Licensed under the MIT license.
delta = max - min;
if (delta == 0.0) {
// degenerate case
var widen = max == 0 ? 1 : 0.01;
// Grafana fix: wide Y min and max using increased wideFactor
// when all series values are the same
var wideFactor = 0.25;
var widen = max == 0 ? 1 : max * wideFactor;
if (opts.min == null)
min -= widen;