kesekian kalinya
This commit is contained in:
@@ -72,24 +72,15 @@ export default function LulusTepatWaktuChart({ selectedYear }: Props) {
|
||||
|
||||
const years = [...new Set(data.map(item => item.tahun_angkatan))].sort();
|
||||
|
||||
const pria = years.map(year => {
|
||||
const item = data.find(d => d.tahun_angkatan === year && d.jk === 'Pria');
|
||||
return item ? item.jumlah_lulus_tepat_waktu : 0;
|
||||
});
|
||||
|
||||
const wanita = years.map(year => {
|
||||
const item = data.find(d => d.tahun_angkatan === year && d.jk === 'Wanita');
|
||||
return item ? item.jumlah_lulus_tepat_waktu : 0;
|
||||
const total = years.map(year => {
|
||||
const yearData = data.filter(d => d.tahun_angkatan === year);
|
||||
return yearData.reduce((sum, item) => sum + item.jumlah_lulus_tepat_waktu, 0);
|
||||
});
|
||||
|
||||
return [
|
||||
{
|
||||
name: 'Laki-laki',
|
||||
data: pria
|
||||
},
|
||||
{
|
||||
name: 'Perempuan',
|
||||
data: wanita
|
||||
name: 'Total Lulus Tepat Waktu',
|
||||
data: total
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -178,12 +169,13 @@ export default function LulusTepatWaktuChart({ selectedYear }: Props) {
|
||||
show: true,
|
||||
color: theme === 'dark' ? '#374151' : '#E5E7EB'
|
||||
},
|
||||
min: 0,
|
||||
tickAmount: 5,
|
||||
},
|
||||
fill: {
|
||||
opacity: 1
|
||||
},
|
||||
colors: ['#3B82F6', '#EC4899'],
|
||||
colors: ['#10B981'],
|
||||
tooltip: {
|
||||
theme: theme === 'dark' ? 'dark' : 'light',
|
||||
y: {
|
||||
@@ -193,17 +185,7 @@ export default function LulusTepatWaktuChart({ selectedYear }: Props) {
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
position: 'top',
|
||||
fontSize: '14px',
|
||||
markers: {
|
||||
size: 12,
|
||||
},
|
||||
itemMargin: {
|
||||
horizontal: 10,
|
||||
},
|
||||
labels: {
|
||||
colors: theme === 'dark' ? '#fff' : '#000'
|
||||
}
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
borderColor: theme === 'dark' ? '#374151' : '#E5E7EB',
|
||||
|
||||
Reference in New Issue
Block a user