From e7b728cb86f1723ca994e73732d82ae3d76bc20c Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Wed, 15 Mar 2023 16:17:31 +0100 Subject: [PATCH] fix: set height on chart container when not defined This fixes a cutoff issue in dashboard. It didn't affect the app, where everything still seems to work fine. --- .../VisualizationPlugin/VisualizationPlugin.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/VisualizationPlugin/VisualizationPlugin.js b/src/components/VisualizationPlugin/VisualizationPlugin.js index 65ad2f7704..ba560be6d5 100644 --- a/src/components/VisualizationPlugin/VisualizationPlugin.js +++ b/src/components/VisualizationPlugin/VisualizationPlugin.js @@ -267,6 +267,12 @@ export const VisualizationPlugin = ({ } : style + // force height when no value available otherwise the PivotTable container sets 0 as height hiding the table content + // and Highcharts does not render correctly the chart/legend + if (!transformedStyle.height) { + transformedStyle.height = '100%' + } + const getLegendKey = () => { if (hasLegendSet && forDashboard) { return ( @@ -330,11 +336,7 @@ export const VisualizationPlugin = ({ onDrill ? onToggleContextualMenu : undefined } id={id} - // force height when no value available otherwise the PivotTable container sets 0 as height hiding the table content - style={{ - ...transformedStyle, - height: transformedStyle.height || '100%', - }} + style={transformedStyle} /> ) : (