diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx
index da8a077..d61ad6c 100644
--- a/app/dashboard/page.tsx
+++ b/app/dashboard/page.tsx
@@ -21,6 +21,7 @@ import NamaBeasiswaDashPieChartPerangkatan from "@/components/chartsDashboard/Na
import TingkatPrestasiChart from "@/components/chartsDashboard/TingkatPrestasiDashChart";
import ProvinsiMahasiswaChart from "@/components/chartsDashboard/ProvinsiMahasiswaPieChart";
import TingkatPrestasiPieChartDash from "@/components/chartsDashboard/TingkatPrestasiPieChartDash";
+import LulusTepatWaktuChart from "@/components/charts/LulusTepatWaktuChart";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
export default function TotalMahasiswaPage() {
@@ -61,7 +62,7 @@ export default function TotalMahasiswaPage() {
{/* Study Duration Section */}
-
+
diff --git a/components/charts/LulusTepatWaktuChart.tsx b/components/charts/LulusTepatWaktuChart.tsx
index 88edc91..b44ed09 100644
--- a/components/charts/LulusTepatWaktuChart.tsx
+++ b/components/charts/LulusTepatWaktuChart.tsx
@@ -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',