diff --git a/frontend/app.js b/frontend/app.js index bc53bf4..dddde62 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -48,6 +48,11 @@ const CHART_COLORS = [ "#9b59b6", // violet ]; +// Helper to get chart aspect ratio based on screen size +function getChartAspectRatio() { + return window.innerWidth <= 768 ? 1.2 : 2; +} + // ============================================================================= // DOM ELEMENTS // ============================================================================= @@ -804,7 +809,7 @@ async function updateComparisonChart() { options: { responsive: true, maintainAspectRatio: true, - aspectRatio: 2, + aspectRatio: getChartAspectRatio(), plugins: { legend: { position: "bottom", @@ -1068,7 +1073,7 @@ async function openSchoolModal(urn) { options: { responsive: true, maintainAspectRatio: true, - aspectRatio: 2, + aspectRatio: getChartAspectRatio(), plugins: { legend: { position: "bottom",