From 667993eae78f29ce3263ab2b7be4cd9c090ccfd5 Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Wed, 21 Sep 2022 05:58:12 +0100 Subject: [PATCH] Dashboard: Single right-aligned y axis loses gridlines (#54206) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: gitstart Co-authored-by: gitstart Co-authored-by: Nitesh Singh Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com> Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com> Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com> Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com> Co-authored-by: Júlio Piubello da Silva Cabral Co-authored-by: Thiago Nascimbeni Co-authored-by: gitstart Co-authored-by: gitstart Co-authored-by: Nitesh Singh Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com> Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com> Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com> Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com> Co-authored-by: Júlio Piubello da Silva Cabral Co-authored-by: Thiago Nascimbeni --- .../src/components/uPlot/config/UPlotConfigBuilder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/uPlot/config/UPlotConfigBuilder.ts b/packages/grafana-ui/src/components/uPlot/config/UPlotConfigBuilder.ts index ab9b722cc1f..839935cd1e5 100644 --- a/packages/grafana-ui/src/components/uPlot/config/UPlotConfigBuilder.ts +++ b/packages/grafana-ui/src/components/uPlot/config/UPlotConfigBuilder.ts @@ -269,7 +269,10 @@ export class UPlotConfigBuilder { const xAxis = axes.find((a) => a.props.scaleKey === 'x'); const axesWithoutGridSet = axes.filter((a) => a.props.grid?.show === undefined); const firstValueAxisIdx = axesWithoutGridSet.findIndex( - (a) => a.props.placement === AxisPlacement.Left || (a.props.placement === AxisPlacement.Bottom && a !== xAxis) + (a) => + a.props.placement === AxisPlacement.Left || + a.props.placement === AxisPlacement.Right || + (a.props.placement === AxisPlacement.Bottom && a !== xAxis) ); // For all axes with no grid set, set the grid automatically (grid only for first left axis )