Change color
This commit is contained in:
@@ -20,7 +20,7 @@ interface Props {
|
||||
}
|
||||
|
||||
export default function JenisPendaftaranLulusPieChart({ selectedYear }: Props) {
|
||||
const { theme } = useTheme();
|
||||
const { theme, systemTheme } = useTheme();
|
||||
const [data, setData] = useState<JenisPendaftaranLulusData[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@@ -66,7 +66,7 @@ export default function JenisPendaftaranLulusPieChart({ selectedYear }: Props) {
|
||||
reset: true
|
||||
}
|
||||
},
|
||||
background: theme === 'dark' ? '#0F172B' : '#fff',
|
||||
background: theme === 'dark' || systemTheme === 'dark' ? '#0F172B' : '#fff',
|
||||
},
|
||||
labels: [],
|
||||
colors: ['#3B82F6', '#10B981', '#F59E0B', '#EF4444', '#8B5CF6', '#EC4899', '#06B6D4', '#F97316'],
|
||||
@@ -81,7 +81,7 @@ export default function JenisPendaftaranLulusPieChart({ selectedYear }: Props) {
|
||||
horizontal: 10
|
||||
},
|
||||
labels: {
|
||||
colors: theme === 'dark' ? '#fff' : '#000',
|
||||
colors: theme === 'dark' || systemTheme === 'dark' ? '#fff' : '#000',
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
@@ -100,7 +100,7 @@ export default function JenisPendaftaranLulusPieChart({ selectedYear }: Props) {
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
theme: theme === 'dark' ? 'dark' : 'light',
|
||||
theme: theme === 'dark' || systemTheme === 'dark' ? 'dark' : 'light',
|
||||
y: {
|
||||
formatter: function (val: number) {
|
||||
return val + " mahasiswa"
|
||||
@@ -174,14 +174,14 @@ export default function JenisPendaftaranLulusPieChart({ selectedYear }: Props) {
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="h-[350px] w-full max-w-5xl mx-auto">
|
||||
<div className="h-[300px] w-full max-w-5xl mx-auto">
|
||||
{typeof window !== 'undefined' && (
|
||||
<Chart
|
||||
options={{...chartOptions, labels}}
|
||||
series={series}
|
||||
type="pie"
|
||||
height="100%"
|
||||
width="90%"
|
||||
width="100%"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user