Fix Bug
This commit is contained in:
@@ -55,7 +55,7 @@ export default function JenisPendaftaranPerAngkatanChart({ tahunAngkatan }: Prop
|
|||||||
horizontal: 10
|
horizontal: 10
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
colors: theme === 'dark' || systemTheme === 'dark' ? '#fff' : '#000'
|
colors: theme === 'dark' ? '#fff' : '#000'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataLabels: {
|
dataLabels: {
|
||||||
@@ -74,7 +74,7 @@ export default function JenisPendaftaranPerAngkatanChart({ tahunAngkatan }: Prop
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
theme: theme === 'dark' || systemTheme === 'dark' ? 'dark' : 'light',
|
theme: theme === 'dark' ? 'dark' : 'light',
|
||||||
y: {
|
y: {
|
||||||
formatter: function (val: number) {
|
formatter: function (val: number) {
|
||||||
return val + " mahasiswa"
|
return val + " mahasiswa"
|
||||||
@@ -85,26 +85,25 @@ export default function JenisPendaftaranPerAngkatanChart({ tahunAngkatan }: Prop
|
|||||||
|
|
||||||
// Update theme when it changes
|
// Update theme when it changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const currentTheme = theme === 'system' ? systemTheme : theme;
|
|
||||||
setOptions(prev => ({
|
setOptions(prev => ({
|
||||||
...prev,
|
...prev,
|
||||||
chart: {
|
chart: {
|
||||||
...prev.chart,
|
...prev.chart,
|
||||||
background: currentTheme === 'dark' || systemTheme === 'dark' ? '#0F172B' : '#fff',
|
background: theme === 'dark' ? '#0F172B' : '#fff',
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
...prev.legend,
|
...prev.legend,
|
||||||
labels: {
|
labels: {
|
||||||
...prev.legend?.labels,
|
...prev.legend?.labels,
|
||||||
colors: currentTheme === 'dark' || systemTheme === 'dark' ? '#fff' : '#000'
|
colors: theme === 'dark' ? '#fff' : '#000'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
...prev.tooltip,
|
...prev.tooltip,
|
||||||
theme: currentTheme === 'dark' || systemTheme === 'dark' ? 'dark' : 'light'
|
theme: theme === 'dark' ? 'dark' : 'light'
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}, [theme, systemTheme]);
|
}, [theme]);
|
||||||
|
|
||||||
// Update dataLabels formatter when data changes
|
// Update dataLabels formatter when data changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user