ayo commit lagi
This commit is contained in:
@@ -65,9 +65,18 @@ export default function StatusMahasiswaPieChartPerangkatan({ selectedYear }: Pro
|
||||
fetchData();
|
||||
}, [selectedYear]);
|
||||
|
||||
// Color mapping consistent with StatusMahasiswaChart bar chart
|
||||
const STATUS_COLOR_MAP: { [key: string]: string } = {
|
||||
'Aktif': '#008FFB',
|
||||
'Lulus': '#00E396',
|
||||
'Cuti': '#FEB019',
|
||||
'Non Aktif': '#EF4444',
|
||||
};
|
||||
|
||||
// Prepare data for pie chart
|
||||
const series = data.map(item => item.jumlah);
|
||||
const labels = data.map(item => item.status_kuliah);
|
||||
const colors = data.map(item => STATUS_COLOR_MAP[item.status_kuliah] || '#775DD0');
|
||||
|
||||
const chartOptions: ApexOptions = {
|
||||
chart: {
|
||||
@@ -103,13 +112,7 @@ export default function StatusMahasiswaPieChartPerangkatan({ selectedYear }: Pro
|
||||
colors: theme === 'dark' ? '#fff' : '#000'
|
||||
}
|
||||
},
|
||||
colors: [
|
||||
'#00E396', // Aktif - Green
|
||||
'#008FFB', // Lulus - Blue
|
||||
'#FEB019', // Cuti - Orange
|
||||
'#FF4560', // Non-Aktif - Red
|
||||
'#775DD0', // Lainnya - Purple
|
||||
],
|
||||
colors: colors,
|
||||
tooltip: {
|
||||
theme: theme === 'dark' ? 'dark' : 'light',
|
||||
y: {
|
||||
|
||||
Reference in New Issue
Block a user