Took a while but I think I got the font color of charts to change as well
This commit is contained in:
@@ -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";
|
||||||
})
|
})
|
||||||
@@ -166,7 +166,6 @@ function createChart(gradeDist, courseName) {
|
|||||||
options: {
|
options: {
|
||||||
legend: {
|
legend: {
|
||||||
labels: {
|
labels: {
|
||||||
fontColor: "#F8F0E5",
|
|
||||||
fontSize: 15
|
fontSize: 15
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user