mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 01:16:31 -06:00
TimeSeries: Fix log y scale when min/max settings don't land on divisors (#60768)
This commit is contained in:
parent
6bfd21ef0a
commit
52955d88a7
@ -116,7 +116,7 @@ export class UPlotScaleBuilder extends PlotConfigBuilder<ScaleProps, Scale> {
|
||||
minMax = uPlot.rangeNum(hardMinOnly ? hardMin : dataMin, hardMaxOnly ? hardMax : dataMax, rangeConfig);
|
||||
}
|
||||
} else if (scale.distr === 3) {
|
||||
minMax = uPlot.rangeLog(dataMin!, dataMax!, logBase, true);
|
||||
minMax = uPlot.rangeLog(hardMin ?? dataMin!, hardMax ?? dataMax!, logBase, true);
|
||||
}
|
||||
|
||||
if (decimals === 0) {
|
||||
@ -154,13 +154,15 @@ export class UPlotScaleBuilder extends PlotConfigBuilder<ScaleProps, Scale> {
|
||||
}
|
||||
}
|
||||
|
||||
// if all we got were hard limits, treat them as static min/max
|
||||
if (hardMinOnly) {
|
||||
minMax[0] = hardMin!;
|
||||
}
|
||||
if (scale.distr === 1) {
|
||||
// if all we got were hard limits, treat them as static min/max
|
||||
if (hardMinOnly) {
|
||||
minMax[0] = hardMin!;
|
||||
}
|
||||
|
||||
if (hardMaxOnly) {
|
||||
minMax[1] = hardMax!;
|
||||
if (hardMaxOnly) {
|
||||
minMax[1] = hardMax!;
|
||||
}
|
||||
}
|
||||
|
||||
// guard against invalid y ranges
|
||||
|
Loading…
Reference in New Issue
Block a user