Took a while but I think I got the font color of charts to change as well

This commit is contained in:
2023-12-28 14:08:37 -06:00
parent ca7bea8af7
commit 505786434e
2 changed files with 3 additions and 2 deletions

View File

@@ -1,4 +1,6 @@
const colorToggle = document.getElementById("colorToggle") const colorToggle = document.getElementById("colorToggle")
colorToggle.addEventListener("change", () => { colorToggle.addEventListener("change", () => {
document.body.classList.toggle("dark") const darkModeEnabled = document.body.classList.toggle("dark");
Chart.defaults.global.defaultFontColor = darkModeEnabled ? "#484b6a" : "#F8F0E5";
// Chart.defaults.plugins.legend.labels.color = isDarkModeEnabled ? "#484b6a" : "#F8F0E5";
}) })

View File

@@ -166,7 +166,6 @@ function createChart(gradeDist, courseName) {
options: { options: {
legend: { legend: {
labels: { labels: {
fontColor: "#F8F0E5",
fontSize: 15 fontSize: 15
} }
}, },