From bf248459f8818af23ddf3989cf9eb13b61037850 Mon Sep 17 00:00:00 2001 From: Randa Firman Putra Date: Sat, 6 Sep 2025 20:55:57 +0700 Subject: [PATCH] First Commit --- app/dashboard/page.tsx | 2 +- app/page.tsx | 2 +- components/charts/AsalDaerahChart.tsx | 14 +++++++- .../charts/AsalDaerahPerAngkatanChart.tsx | 14 +++++++- package-lock.json | 33 +++++++++++++++++++ package.json | 2 ++ 6 files changed, 63 insertions(+), 4 deletions(-) diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index d61ad6c..7f26a98 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -104,7 +104,7 @@ export default function TotalMahasiswaPage() { {/* Demographics Section */} -
+
diff --git a/app/page.tsx b/app/page.tsx index 971842b..fce41e8 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -203,7 +203,7 @@ export default function DashboardPage() {
-
+
diff --git a/components/charts/AsalDaerahChart.tsx b/components/charts/AsalDaerahChart.tsx index 464d280..613e941 100644 --- a/components/charts/AsalDaerahChart.tsx +++ b/components/charts/AsalDaerahChart.tsx @@ -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 ( @@ -261,7 +270,10 @@ export default function AsalDaerahChart() { -
+
{ + 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 ( @@ -307,7 +316,10 @@ export default function AsalDaerahPerAngkatanChart({ tahunAngkatan }: Props) { -
+