);
}
const periods = data ?? [];
// Collect all group names
const allGroups = new Set();
for (const p of periods) {
for (const g of p.groups) allGroups.add(g.name);
}
const groups = [...allGroups].slice(0, 10);
// Build recharts data
const chartData = periods.map((p) => {
const row: Record = { period: p.period, capacity: p.capacityHours };
for (const g of p.groups) {
row[g.name] = g.hours;
}
return row;
});
return (
{/* Controls + info */}
Stacked bars = booked hours per group per period (last 2 months to next 6 months).
Red dashed line = total capacity estimate (all active resources × available hours per day × working days).
Bars exceeding the capacity line indicate over-allocation risk.
}
width="w-80"
position="bottom"
/>