testing yuk
This commit is contained in:
@@ -6,7 +6,7 @@ import { ApexOptions } from 'apexcharts';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
|
||||
// Dynamically import ApexCharts to avoid SSR issues
|
||||
// Import ApexCharts secara dinamis untuk menghindari masalah SSR
|
||||
const Chart = dynamic(() => import('react-apexcharts'), { ssr: false });
|
||||
|
||||
interface AsalDaerahLulusChartProps {
|
||||
@@ -110,7 +110,7 @@ export default function AsalDaerahLulusChart({ selectedYear }: AsalDaerahLulusCh
|
||||
fill: {
|
||||
opacity: 1,
|
||||
},
|
||||
colors: ['#3B82F6'], // Blue color for bars
|
||||
colors: ['#3B82F6'], // Warna biru untuk bar
|
||||
tooltip: {
|
||||
theme: theme === 'dark' ? 'dark' : 'light',
|
||||
y: {
|
||||
@@ -121,7 +121,7 @@ export default function AsalDaerahLulusChart({ selectedYear }: AsalDaerahLulusCh
|
||||
}
|
||||
});
|
||||
|
||||
// Update theme when it changes
|
||||
// Perbarui tema saat berubah
|
||||
useEffect(() => {
|
||||
const currentTheme = theme;
|
||||
setOptions(prev => ({
|
||||
@@ -196,7 +196,7 @@ export default function AsalDaerahLulusChart({ selectedYear }: AsalDaerahLulusCh
|
||||
const data = await response.json();
|
||||
setChartData(data);
|
||||
|
||||
// Process data for chart
|
||||
// Proses data untuk chart
|
||||
const kabupaten = data.map((item: ChartData) => item.kabupaten);
|
||||
const jumlah = data.map((item: ChartData) => item.jumlah_lulus_tepat_waktu);
|
||||
|
||||
@@ -212,7 +212,7 @@ export default function AsalDaerahLulusChart({ selectedYear }: AsalDaerahLulusCh
|
||||
},
|
||||
}));
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : 'An error occurred');
|
||||
setError(err instanceof Error ? err.message : 'Terjadi kesalahan');
|
||||
console.error('Error fetching data:', err);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user