From b4491b136f2705607dad0eacbbfea47820b6fedc Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Fri, 6 Jan 2023 15:14:15 -0800 Subject: [PATCH] Fix show legend in bar charts (#175) Signed-off-by: Joshua Li Signed-off-by: Joshua Li --- public/components/visualizations/charts/bar/bar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/components/visualizations/charts/bar/bar.tsx b/public/components/visualizations/charts/bar/bar.tsx index 53c7ae5de..a0aaaf38b 100644 --- a/public/components/visualizations/charts/bar/bar.tsx +++ b/public/components/visualizations/charts/bar/bar.tsx @@ -85,7 +85,7 @@ export const Bar = ({ visualizations, layout, config }: any) => { const tooltipText = tooltipOptions.tooltipText !== undefined ? tooltipOptions.tooltipText : 'all'; const barWidth = 1 - (chartStyles.barWidth || barwidth); const groupWidth = 1 - (chartStyles.groupWidth || groupwidth); - const showLegend = legend.showLegend ?? showlegend; + const showLegend = legend.showLegend === 'hidden' ? false : showlegend; const legendPosition = legend.position || legendposition; const labelSize = chartStyles.labelSize || DEFAULT_BAR_CHART_STYLES.LabelSize; const legendSize = legend.legendSize; @@ -180,7 +180,7 @@ export const Bar = ({ visualizations, layout, config }: any) => { }, }), }, - showlegend, + showlegend: showLegend, hovermode: 'closest', margin: PLOT_MARGIN, };