From 29092b23baa2dfc1bddab6b671e7babc4717b179 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Fri, 23 Feb 2024 17:36:11 +0000 Subject: [PATCH] Refactor GanttChart component to set timeline width dynamically --- CommonUI/src/Components/GanttChart/Bar/Index.tsx | 1 - CommonUI/src/Components/GanttChart/Index.tsx | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CommonUI/src/Components/GanttChart/Bar/Index.tsx b/CommonUI/src/Components/GanttChart/Bar/Index.tsx index 3065d55946..f2f433356f 100644 --- a/CommonUI/src/Components/GanttChart/Bar/Index.tsx +++ b/CommonUI/src/Components/GanttChart/Bar/Index.tsx @@ -88,7 +88,6 @@ const Bar: FunctionComponent = (
= ( setEachIntervalWidth(chartWidth / numberOfInterval); } - setTimelineWidth(chartWidth * 0.75); // 75 % of chart width, 25% for category spacer + + const timelineWidth: number = chartWidth * 0.75; // 75 % of chart width, 25% for category spacer + + setTimelineWidth(timelineWidth); // 75 % of chart width, 25% for category spacer }, [chartWidth]); return (