From 4e22823a4962c3e0259ddc3200e7667998a8b168 Mon Sep 17 00:00:00 2001 From: Andreas Gerstmayr Date: Tue, 7 Sep 2021 16:20:29 +0200 Subject: [PATCH] uPlot: Fix default value for plot legend visibility (#36660) Fixed the condition, as the last part of `!seriesConfig.show ?? false` will never be evaluated because `!seriesConfig.show` always yields a boolean. --- packages/grafana-ui/src/components/uPlot/PlotLegend.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/uPlot/PlotLegend.tsx b/packages/grafana-ui/src/components/uPlot/PlotLegend.tsx index e0a6fe1ff7f..847a268870f 100644 --- a/packages/grafana-ui/src/components/uPlot/PlotLegend.tsx +++ b/packages/grafana-ui/src/components/uPlot/PlotLegend.tsx @@ -52,7 +52,7 @@ export const PlotLegend: React.FC = ({ const seriesColor = scaleColor.color; return { - disabled: !seriesConfig.show ?? false, + disabled: !(seriesConfig.show ?? true), fieldIndex, color: seriesColor, label,