testing yuk
This commit is contained in:
@@ -9,7 +9,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { ExternalLink } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
|
||||
// Dynamically import ApexCharts to avoid SSR issues
|
||||
// Import ApexCharts secara dinamis untuk menghindari masalah SSR
|
||||
const Chart = dynamic(() => import('react-apexcharts'), { ssr: false });
|
||||
|
||||
interface IPKData {
|
||||
@@ -145,7 +145,7 @@ export default function IPKChart({
|
||||
left: 0
|
||||
}
|
||||
},
|
||||
colors: ['#3B82F6'], // Blue color for line
|
||||
colors: ['#3B82F6'], // Warna biru untuk garis
|
||||
tooltip: {
|
||||
theme: theme === 'dark' ? 'dark' : 'light',
|
||||
y: {
|
||||
@@ -167,7 +167,7 @@ export default function IPKChart({
|
||||
}
|
||||
});
|
||||
|
||||
// Update theme when it changes
|
||||
// Perbarui tema saat berubah
|
||||
useEffect(() => {
|
||||
const currentTheme = theme;
|
||||
setOptions(prev => ({
|
||||
@@ -256,12 +256,12 @@ export default function IPKChart({
|
||||
const result = await response.json();
|
||||
|
||||
if (!Array.isArray(result)) {
|
||||
throw new Error('Invalid data format received from server');
|
||||
throw new Error('Format data tidak valid diterima dari server');
|
||||
}
|
||||
|
||||
setData(result);
|
||||
|
||||
// Process data for chart
|
||||
// Proses data untuk chart
|
||||
const tahunAngkatan = result.map(item => item.tahun_angkatan);
|
||||
const rataRataIPK = result.map(item => item.rata_rata_ipk);
|
||||
|
||||
@@ -278,7 +278,7 @@ export default function IPKChart({
|
||||
}));
|
||||
} catch (err) {
|
||||
console.error('Error in fetchData:', err);
|
||||
setError(err instanceof Error ? err.message : 'An error occurred while fetching data');
|
||||
setError(err instanceof Error ? err.message : 'Terjadi kesalahan saat mengambil data');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user