diff --git a/mockups/admissions-chartjs-check.html b/mockups/admissions-chartjs-check.html index 860bcdb..b391b21 100644 --- a/mockups/admissions-chartjs-check.html +++ b/mockups/admissions-chartjs-check.html @@ -50,7 +50,7 @@ new Chart(document.getElementById('c'),{ type:'line', data:{labels,datasets:[{ - label:'First-choice offer rate',data:values, + label:'First-choice offer rate',data:values,clip:false, borderColor:'#e07256',backgroundColor:'rgba(224,114,86,0.10)', borderWidth:2.5,tension:0.3,fill:true, pointRadius:values.map((_,i)=>i===lastIdx?5:3), @@ -59,6 +59,7 @@ }]}, options:{ responsive:true,maintainAspectRatio:false, + layout:{padding:{top:8}}, interaction:{mode:'index',intersect:false}, plugins:{legend:{display:false},title:{display:false}, tooltip:{backgroundColor:'rgba(26,22,18,0.92)',padding:10,callbacks:{label:ctx=>`First-choice offers: ${Math.round(ctx.parsed.y)}%`}}}, diff --git a/nextjs-app/components/AdmissionsTrendChart.tsx b/nextjs-app/components/AdmissionsTrendChart.tsx index cd80661..caeaf4f 100644 --- a/nextjs-app/components/AdmissionsTrendChart.tsx +++ b/nextjs-app/components/AdmissionsTrendChart.tsx @@ -32,6 +32,9 @@ export default function AdmissionsTrendChart({ history }: { history: SchoolAdmis responsive: true, maintainAspectRatio: false, interaction: { mode: 'index', intersect: false }, + // Headroom so a point sitting on the y-max ceiling (e.g. 100%) isn't + // clipped by the top of the plot area. + layout: { padding: { top: 8 } }, plugins: { legend: { display: false }, title: { display: false }, @@ -65,6 +68,7 @@ export default function AdmissionsTrendChart({ history }: { history: SchoolAdmis { label: 'First-choice offer rate', data: values, + clip: false as const, borderColor: '#e07256', backgroundColor: 'rgba(224,114,86,0.10)', borderWidth: 2.5,