kesekian kalinya
This commit is contained in:
@@ -21,6 +21,7 @@ import NamaBeasiswaDashPieChartPerangkatan from "@/components/chartsDashboard/Na
|
|||||||
import TingkatPrestasiChart from "@/components/chartsDashboard/TingkatPrestasiDashChart";
|
import TingkatPrestasiChart from "@/components/chartsDashboard/TingkatPrestasiDashChart";
|
||||||
import ProvinsiMahasiswaChart from "@/components/chartsDashboard/ProvinsiMahasiswaPieChart";
|
import ProvinsiMahasiswaChart from "@/components/chartsDashboard/ProvinsiMahasiswaPieChart";
|
||||||
import TingkatPrestasiPieChartDash from "@/components/chartsDashboard/TingkatPrestasiPieChartDash";
|
import TingkatPrestasiPieChartDash from "@/components/chartsDashboard/TingkatPrestasiPieChartDash";
|
||||||
|
import LulusTepatWaktuChart from "@/components/charts/LulusTepatWaktuChart";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
|
|
||||||
export default function TotalMahasiswaPage() {
|
export default function TotalMahasiswaPage() {
|
||||||
@@ -61,7 +62,7 @@ export default function TotalMahasiswaPage() {
|
|||||||
|
|
||||||
{/* Study Duration Section */}
|
{/* Study Duration Section */}
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<MasaStudiAktifChart selectedYear={selectedYear} />
|
<LulusTepatWaktuChart selectedYear={selectedYear} />
|
||||||
<MasaStudiLulusChart selectedYear={selectedYear} />
|
<MasaStudiLulusChart selectedYear={selectedYear} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -72,24 +72,15 @@ export default function LulusTepatWaktuChart({ selectedYear }: Props) {
|
|||||||
|
|
||||||
const years = [...new Set(data.map(item => item.tahun_angkatan))].sort();
|
const years = [...new Set(data.map(item => item.tahun_angkatan))].sort();
|
||||||
|
|
||||||
const pria = years.map(year => {
|
const total = years.map(year => {
|
||||||
const item = data.find(d => d.tahun_angkatan === year && d.jk === 'Pria');
|
const yearData = data.filter(d => d.tahun_angkatan === year);
|
||||||
return item ? item.jumlah_lulus_tepat_waktu : 0;
|
return yearData.reduce((sum, item) => sum + 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;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: 'Laki-laki',
|
name: 'Total Lulus Tepat Waktu',
|
||||||
data: pria
|
data: total
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Perempuan',
|
|
||||||
data: wanita
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -178,12 +169,13 @@ export default function LulusTepatWaktuChart({ selectedYear }: Props) {
|
|||||||
show: true,
|
show: true,
|
||||||
color: theme === 'dark' ? '#374151' : '#E5E7EB'
|
color: theme === 'dark' ? '#374151' : '#E5E7EB'
|
||||||
},
|
},
|
||||||
|
min: 0,
|
||||||
tickAmount: 5,
|
tickAmount: 5,
|
||||||
},
|
},
|
||||||
fill: {
|
fill: {
|
||||||
opacity: 1
|
opacity: 1
|
||||||
},
|
},
|
||||||
colors: ['#3B82F6', '#EC4899'],
|
colors: ['#10B981'],
|
||||||
tooltip: {
|
tooltip: {
|
||||||
theme: theme === 'dark' ? 'dark' : 'light',
|
theme: theme === 'dark' ? 'dark' : 'light',
|
||||||
y: {
|
y: {
|
||||||
@@ -193,17 +185,7 @@ export default function LulusTepatWaktuChart({ selectedYear }: Props) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
position: 'top',
|
show: false
|
||||||
fontSize: '14px',
|
|
||||||
markers: {
|
|
||||||
size: 12,
|
|
||||||
},
|
|
||||||
itemMargin: {
|
|
||||||
horizontal: 10,
|
|
||||||
},
|
|
||||||
labels: {
|
|
||||||
colors: theme === 'dark' ? '#fff' : '#000'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
borderColor: theme === 'dark' ? '#374151' : '#E5E7EB',
|
borderColor: theme === 'dark' ? '#374151' : '#E5E7EB',
|
||||||
|
|||||||
Reference in New Issue
Block a user