From 472ebed3be4fb9aabf1324fe0d6bec5f0128640c Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Mon, 30 Mar 2026 15:03:04 +0100 Subject: [PATCH] feat: update chart height calculation to include widget header and adjust per-chart overhead --- .../Dashboard/Components/DashboardChartComponent.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/App/FeatureSet/Dashboard/src/Components/Dashboard/Components/DashboardChartComponent.tsx b/App/FeatureSet/Dashboard/src/Components/Dashboard/Components/DashboardChartComponent.tsx index 6ea5411326..787e56004f 100644 --- a/App/FeatureSet/Dashboard/src/Components/Dashboard/Components/DashboardChartComponent.tsx +++ b/App/FeatureSet/Dashboard/src/Components/Dashboard/Components/DashboardChartComponent.tsx @@ -181,10 +181,17 @@ const DashboardChartComponentElement: FunctionComponent = ( } const numberOfCharts: number = queryConfigs.length || 1; - // Each chart section in ChartGroup has ~60px overhead for title + padding - const perChartOverhead: number = 60; + // Account for widget-level header and per-chart overhead (title + legend + padding) + const hasWidgetHeader: boolean = !!( + props.component.arguments.chartTitle || + props.component.arguments.chartDescription + ); + const widgetHeaderHeight: number = hasWidgetHeader ? 50 : 0; + // Each chart section: pt-5(20) + title(20) + legend(24) + pb-4(16) = ~80px overhead + const perChartOverhead: number = 80; let heightOfChart: number | undefined = ((props.dashboardComponentHeightInPx || 0) - + widgetHeaderHeight - numberOfCharts * perChartOverhead) / numberOfCharts;