fix(admissions): render trend with Chart.js instead of scaled SVG

The hand-rolled SVG sparkline used px font sizes inside a 520-wide viewBox
that stretched to the full card width, so labels ballooned ~4x and collided —
and with 10+ years of real data the per-point labels and year ticks
overlapped badly, while the oversized chart stretched the "this year" view.

Replace it with a Chart.js line chart (AdmissionsTrendChart) in a fixed
200px wrapper, matching PerformanceChart: responsive px fonts, auto-skipping
x ticks, auto-scaled y-axis clamped to 0-100, emphasised latest point.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tudor
2026-06-19 18:59:57 +01:00
co-authored by Claude Opus 4.8
parent 4de7e559e9
commit 368b9f2b59
5 changed files with 172 additions and 100 deletions
@@ -1381,49 +1381,6 @@
margin-bottom: 0.5rem;
}
.admissionsChart {
width: 100%;
height: auto;
display: block;
}
.admissionsGrid {
stroke: var(--border-color, #e5dfd5);
stroke-width: 1;
}
.admissionsAxis {
font-size: 12.5px;
fill: var(--text-muted, #6d685f);
font-family: var(--font-dm-sans), "DM Sans", sans-serif;
}
.admissionsLine {
stroke: var(--accent-coral, #e07256);
stroke-width: 3;
}
.admissionsDot {
fill: var(--accent-coral, #e07256);
}
.admissionsDotLast {
fill: var(--accent-coral, #e07256);
stroke: var(--bg-card, #fff);
stroke-width: 2;
}
.admissionsPtLabel {
font-size: 13px;
font-weight: 700;
fill: var(--text-primary, #1a1612);
font-family: var(--font-dm-sans), "DM Sans", sans-serif;
}
.admissionsPtLabel[data-last="true"] {
fill: var(--accent-coral-dark, #c45a3f);
}
.admissionsTrendSummary {
font-size: 1rem;
color: var(--text-secondary, #5c564d);