mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TimeSeries: Fix centeredZero y axis ranging when all values are 0 (#69034)
This commit is contained in:
parent
37e2becdd7
commit
014126a43e
@ -173,6 +173,12 @@ export class UPlotScaleBuilder extends PlotConfigBuilder<ScaleProps, Scale> {
|
||||
let absMin = Math.abs(dataMin!);
|
||||
let absMax = Math.abs(dataMax!);
|
||||
let max = Math.max(absMin, absMax);
|
||||
|
||||
// flat 0
|
||||
if (max === 0) {
|
||||
max = 80;
|
||||
}
|
||||
|
||||
dataMin = -max;
|
||||
dataMax = max;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user