First Commit

This commit is contained in:
Randa Firman Putra
2025-09-06 20:55:57 +07:00
parent 87986da7ee
commit bf248459f8
6 changed files with 63 additions and 4 deletions

View File

@@ -253,6 +253,15 @@ export default function AsalDaerahChart() {
);
}
// Calculate dynamic height based on number of kabupaten
const calculateHeight = () => {
const minHeight = 200;
const barHeight = 25; // Height per bar in pixels
const padding = 100; // Extra space for title, legend, etc.
const dynamicHeight = Math.max(minHeight, (data.length * barHeight) + padding);
return `${dynamicHeight}px`;
};
return (
<Card className="bg-white dark:bg-slate-900 shadow-lg">
<CardHeader>
@@ -261,7 +270,10 @@ export default function AsalDaerahChart() {
</CardTitle>
</CardHeader>
<CardContent>
<div className="h-[400px] sm:h-[400px] md:h-[400px] w-full max-w-5xl mx-auto">
<div
className="w-full max-w-5xl mx-auto"
style={{ height: calculateHeight() }}
>
<Chart
options={options}
series={series}