diff --git a/components/charts/WeeklyStatsChart.tsx b/components/charts/WeeklyStatsChart.tsx index a4f62a1..a47eed9 100644 --- a/components/charts/WeeklyStatsChart.tsx +++ b/components/charts/WeeklyStatsChart.tsx @@ -27,6 +27,9 @@ function shortDay(localDate: string): string { export default function WeeklyStatsChart({ data, hasFastLane, mode }: Props) { const showFastLane = mode === "fastLane" && hasFastLane; + const avgColor = showFastLane ? "#ff4d8d" : "#4ade80"; + const maxColor = showFastLane ? "#ff4d8d" : "#22c55e"; + const maxFill = showFastLane ? "#3d0f22" : "#0a1a0d"; const chartData = data.map((d) => ({ day: shortDay(d.localDate), avg: showFastLane @@ -43,22 +46,43 @@ export default function WeeklyStatsChart({ data, hasFastLane, mode }: Props) { { - if (value === null || value === undefined) return ["—", name]; - return [`${value} min`, name]; + cursor={{ fill: "rgba(255,255,255,0.04)" }} + content={({ active, payload, label }) => { + if (!active || !payload || payload.length === 0) return null; + return ( +
+
{label}
+ {payload.map((entry) => { + const color = entry.dataKey === "max" ? maxColor : avgColor; + const v = entry.value; + const display = v === null || v === undefined ? "—" : `${v} min`; + return ( +
+ {entry.name} : {display} +
+ ); + })} +
+ ); }} /> - - - + + value === "Max" ? {value} : value + } + /> + +