This commit is contained in:
Randa Firman Putra
2025-09-16 14:22:37 +07:00
parent f2d15b38e3
commit 886fc59d28
17 changed files with 2386 additions and 30 deletions

View File

@@ -61,7 +61,7 @@ export default function AsalDaerahPerAngkatanChart({ tahunAngkatan }: Props) {
distributed: false,
barHeight: '90%',
dataLabels: {
position: 'top'
position: 'center'
}
}
},
@@ -71,10 +71,9 @@ export default function AsalDaerahPerAngkatanChart({ tahunAngkatan }: Props) {
return val.toString();
},
style: {
fontSize: '14px',
fontSize: '12px',
colors: [theme === 'dark' ? '#fff' : '#000']
},
offsetX: 10,
},
stroke: {
show: true,
@@ -303,7 +302,7 @@ export default function AsalDaerahPerAngkatanChart({ tahunAngkatan }: Props) {
const calculateHeight = () => {
const minHeight = 100;
const barHeight = 15; // Tinggi per bar dalam piksel
const padding = 50; // Ruang ekstra untuk judul, legenda, dll
const padding = 100; // Ruang ekstra untuk judul, legenda, dll
const dynamicHeight = Math.max(minHeight, (data.length * barHeight) + padding);
return `${dynamicHeight}px`;
};
@@ -317,7 +316,7 @@ export default function AsalDaerahPerAngkatanChart({ tahunAngkatan }: Props) {
</CardHeader>
<CardContent>
<div
className="w-full max-w-xl mx-auto"
className="w-full"
style={{ height: calculateHeight() }}
>
<Chart