From 9de7d1a46749343754c9b0aec8fbb9f9544bdf10 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Tue, 23 Dec 2025 11:14:07 +0100 Subject: [PATCH] feat: enhance tooltip functionality in BalanceLineChart; implement custom content rendering for improved data presentation and user interaction, including dynamic styling and formatting of displayed values --- components/statistics/balance-line-chart.tsx | 37 +++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/components/statistics/balance-line-chart.tsx b/components/statistics/balance-line-chart.tsx index fdbefee..3e03609 100644 --- a/components/statistics/balance-line-chart.tsx +++ b/components/statistics/balance-line-chart.tsx @@ -103,11 +103,38 @@ export function BalanceLineChart({ tick={{ fill: "var(--muted-foreground)" }} /> formatCurrency(value)} - contentStyle={{ - backgroundColor: "var(--card)", - border: "1px solid var(--border)", - borderRadius: "8px", + content={({ active, payload }) => { + if (!active || !payload?.length) return null; + return ( +
+ {payload.map((entry, index) => ( +
+
+ + {entry.name}: + + + {formatCurrency(entry.value as number)} + +
+ ))} +
+ ); }} /> {mode === "aggregated" ? (