import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, } from "recharts"; import { DataPoint } from "../types"; interface ChartProps { data: DataPoint[]; dataKey: keyof DataPoint; color: string; unit: string; title: string; } export function DashboardChart({ data, dataKey, color, unit, title, }: ChartProps) { // Simple formatter for Y Axis const formatYAxis = (tickItem: number) => { if (tickItem > 1000) { return `${(tickItem / 1000).toFixed(1)}k`; } return tickItem.toFixed(0); }; return (

{title}

`${t.toFixed(0)}s`} stroke="rgba(255,255,255,0.4)" fontSize={10} tickMargin={8} tickLine={false} axisLine={false} /> [ `${value.toFixed(1)} ${unit}`, title, ]} labelFormatter={(label: number) => `T+ ${label.toFixed(1)}s`} />
); }