From d3c1a2bf8e4437b72743b7c81ac655b1e8e9bb70 Mon Sep 17 00:00:00 2001 From: Leon Sorokin Date: Tue, 15 Jun 2021 17:39:45 -0500 Subject: [PATCH] Time series: fix soft scale limits when all values are 0 (#35596) --- .../src/components/uPlot/config/UPlotScaleBuilder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/uPlot/config/UPlotScaleBuilder.ts b/packages/grafana-ui/src/components/uPlot/config/UPlotScaleBuilder.ts index 98bc6301da3..9de444b9be5 100644 --- a/packages/grafana-ui/src/components/uPlot/config/UPlotScaleBuilder.ts +++ b/packages/grafana-ui/src/components/uPlot/config/UPlotScaleBuilder.ts @@ -39,8 +39,8 @@ export class UPlotScaleBuilder extends PlotConfigBuilder { : {}; // uPlot's default ranging config for both min & max is {pad: 0.1, hard: null, soft: 0, mode: 3} - let softMinMode: Range.SoftMode = softMin == null ? 3 : softMin === 0 ? 1 : 2; - let softMaxMode: Range.SoftMode = softMax == null ? 3 : softMax === 0 ? 1 : 2; + let softMinMode: Range.SoftMode = softMin == null ? 3 : 1; + let softMaxMode: Range.SoftMode = softMax == null ? 3 : 1; const rangeConfig: Range.Config = { min: {