feat: improve balance calculations in statistics page and charts with enhanced formatting for large values

This commit is contained in:
Julien Froidefond
2025-11-30 12:19:34 +01:00
parent 184a073bb1
commit ebf842cf6d
3 changed files with 87 additions and 17 deletions

View File

@@ -90,7 +90,18 @@ export function BalanceLineChart({
className="text-xs"
interval="preserveStartEnd"
/>
<YAxis className="text-xs" tickFormatter={(v) => `${v}`} />
<YAxis
className="text-xs"
width={80}
tickFormatter={(v) => {
// Format compact pour les grandes valeurs
if (Math.abs(v) >= 1000) {
return `${(v / 1000).toFixed(1)}k€`;
}
return `${Math.round(v)}`;
}}
tick={{ fill: "var(--muted-foreground)" }}
/>
<Tooltip
formatter={(value: number) => formatCurrency(value)}
contentStyle={{