mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 07:42:10 +00:00
Refactor GanttChart component to set timeline width dynamically
This commit is contained in:
parent
61be62740a
commit
29092b23ba
@ -88,7 +88,6 @@ const Bar: FunctionComponent<ComponentProps> = (
|
||||
<div
|
||||
className="chart-bar h-8 pt-1 pb-1 mt-2.5 mb-2.5 rounded absolute cursor-pointer ml-1 mr-1"
|
||||
style={{
|
||||
marginLeft: `${barLeftPosition}px`,
|
||||
width: `${barWidth}px`,
|
||||
backgroundColor: `${props.bar.barColor.toString()}`,
|
||||
opacity: barOpacity,
|
||||
|
@ -45,7 +45,10 @@ const GanttChart: FunctionComponent<ComponentProps> = (
|
||||
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 (
|
||||
|
Loading…
Reference in New Issue
Block a user