diff --git a/app/(app)/insights/components/velocity-chart.tsx b/app/(app)/insights/components/velocity-chart.tsx new file mode 100644 index 0000000..d6101b0 --- /dev/null +++ b/app/(app)/insights/components/velocity-chart.tsx @@ -0,0 +1,54 @@ +'use client' + +import { + BarChart, + Bar, + XAxis, + YAxis, + Tooltip, + Legend, + ReferenceLine, + ResponsiveContainer, +} from 'recharts' +import type { VelocityData } from '@/lib/insights/velocity' +import { SERIES_COLORS } from '@/lib/chart-colors' + +interface Props { + data: VelocityData +} + +export function VelocityChart({ data }: Props) { + const { sprints, productNames } = data + + if (sprints.length < 2) { + return ( +
+ Velocity wordt zichtbaar na 2+ voltooide sprints +
+ ) + } + + const chartData = sprints.map((s, i) => { + const row: Record