feat: Adjust chart settings for different screen sizes

This commit is contained in:
Paul Gauthier 2024-09-26 19:02:46 -07:00 committed by Paul Gauthier (aider)
parent 2b03b58018
commit 6230060d6a

View file

@ -57,9 +57,11 @@ top coding models, as compared to their previous "solo" scores (striped bars).
// Function to determine aspect ratio and base font size based on screen width
function getChartSettings() {
if (window.innerWidth < 600) {
return { aspectRatio: 1.2, baseFontSize: 8 }; // Slightly taller for small screens
return { aspectRatio: 1, baseFontSize: 8 }; // Slightly taller for small screens
} else if (window.innerWidth < 800) {
return { aspectRatio: 1.2, baseFontSize: 10 }; // Slightly taller for small screens
} else {
return { aspectRatio: 1.7, baseFontSize: 12 }; // Slightly taller for larger screens
return { aspectRatio: 1.4, baseFontSize: 12 }; // Slightly taller for larger screens
}
}
@ -168,7 +170,7 @@ top coding models, as compared to their previous "solo" scores (striped bars).
position: 'start',
xAdjust: 10,
font: {
size: baseFontSize
size: baseFontSize-4
}
}
}