diff --git a/gerbil-manager-web/src/pages/StatistikPage.tsx b/gerbil-manager-web/src/pages/StatistikPage.tsx index 0948021..d19aa0e 100644 --- a/gerbil-manager-web/src/pages/StatistikPage.tsx +++ b/gerbil-manager-web/src/pages/StatistikPage.tsx @@ -46,6 +46,17 @@ async function allPages(fetchPage: (q: GridifyQuery) => Promise>): P const toBars = (rows: YearValue[]) => rows.map((r) => ({ label: String(r.year), value: r.value })) +/** + * Punktreihe fürs Liniendiagramm ausdünnen (LineChart zeichnet pro Punkt + * einen Kreis — bei >60 Monatspunkten wird die Linie sonst „perlig“). + * Erster und letzter Punkt bleiben immer erhalten. + */ +function thin(points: T[], max = 60): T[] { + if (points.length <= max) return points + const step = Math.ceil(points.length / max) + return points.filter((_, i) => i % step === 0 || i === points.length - 1) +} + function Section({ title, hint, @@ -186,7 +197,11 @@ export default function StatistikPage() {
{stats.population.length >= 2 ? ( - + ) : (

{t.sectionEmpty}

)}