From f7eb170e15ffb1497fc7a6e601cdaa645877eeba Mon Sep 17 00:00:00 2001 From: alberto Date: Tue, 1 Dec 2026 17:29:05 -0600 Subject: [PATCH] One-step ticks only when the axis spans five or less, counted from zero --- src/app/indicadores/figures.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/indicadores/figures.ts b/src/app/indicadores/figures.ts index 832ed55..5725479 100644 --- a/src/app/indicadores/figures.ts +++ b/src/app/indicadores/figures.ts @@ -440,7 +440,7 @@ export function ageShare(r: Reading, axis: string): Figure { export function valueAxis(values: Iterable) { const found = [...values].filter((v): v is number => v != null && Number.isFinite(v)); const counts = found.every(Number.isInteger); - const narrow = found.length > 0 && Math.max(...found) - Math.min(...found) <= 5; + const narrow = found.length > 0 && Math.max(...found) - Math.min(0, ...found) <= 5; return { type: 'linear' as const, tickformat: counts ? 'd' : SHORT,