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

@@ -50,7 +50,7 @@ export default function AsalDaerahChart({
distributed: false,
barHeight: '90%',
dataLabels: {
position: 'top',
position: 'center',
},
},
},
@@ -60,10 +60,9 @@ export default function AsalDaerahChart({
return val.toString();
},
style: {
fontSize: '14px',
fontSize: '12px',
colors: [theme === 'dark' ? '#fff' : '#000']
},
offsetX: 10,
},
stroke: {
show: true,
@@ -268,7 +267,7 @@ export default function AsalDaerahChart({
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`;
};
@@ -292,7 +291,7 @@ export default function AsalDaerahChart({
</CardHeader>
<CardContent>
<div
className={`${height} w-full max-w-xl mx-auto`}
className={`${height} w-full`}
style={{ height: calculateHeight() }}
>
<Chart