diff --git a/src/components/stats/Charts.tsx b/src/components/stats/Charts.tsx index 47cd6c0..a3f2a5f 100644 --- a/src/components/stats/Charts.tsx +++ b/src/components/stats/Charts.tsx @@ -50,12 +50,12 @@ export function Columns({ height = 140, label, }: { - bars: { key: string; axis: string; value: number; tip: string; highlight?: boolean }[] + bars: { key: string; axis: string; value: number; tip: string; highlight?: boolean; /** Masquée par l'utilisateur : pas de barre, libellé barré */ hidden?: boolean }[] height?: number /** Nom du graphique (lecteurs d'écran) */ label: string }) { - const max = Math.max(1, ...bars.map((b) => b.value)) + const max = Math.max(1, ...bars.filter((b) => !b.hidden).map((b) => b.value)) return (
@@ -64,8 +64,8 @@ export function Columns({ {bars.map((b) => (
0 ? 'bg-accent-fill' : 'bg-transparent', !b.highlight && 'opacity-80 group-hover:opacity-100 group-focus-visible:opacity-100')} - style={{ height: b.value > 0 ? `${Math.max(3, (b.value / max) * 100)}%` : 0 }} + className={cx('w-full max-w-9 rounded-t-[4px] transition-opacity', b.value > 0 && !b.hidden ? 'bg-accent-fill' : 'bg-transparent', !b.highlight && 'opacity-80 group-hover:opacity-100 group-focus-visible:opacity-100')} + style={{ height: b.value > 0 && !b.hidden ? `${Math.max(3, (b.value / max) * 100)}%` : 0 }} /> {b.tip} @@ -75,7 +75,7 @@ export function Columns({