kesekian kalinya

This commit is contained in:
Randa Firman Putra
2025-09-07 03:43:41 +07:00
parent bf248459f8
commit eaaf9f6436
3 changed files with 15 additions and 7 deletions

View File

@@ -80,10 +80,14 @@ export default function TotalMahasiswaPage() {
{/* Demographics Section */} {/* Demographics Section */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-4"> <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<div className="col-span-1">
<AsalDaerahChart /> <AsalDaerahChart />
</div>
<div className="col-span-1">
<ProvinsiMahasiswaChart /> <ProvinsiMahasiswaChart />
</div> </div>
</div> </div>
</div>
) : ( ) : (
<div className="space-y-6"> <div className="space-y-6">
{/* Overview Section */} {/* Overview Section */}

View File

@@ -7,6 +7,7 @@ import { useTheme } from "next-themes";
import StatistikMahasiswaChart from "@/components/charts/StatistikMahasiswaChart"; import StatistikMahasiswaChart from "@/components/charts/StatistikMahasiswaChart";
import JenisPendaftaranChart from "@/components/charts/JenisPendaftaranChart"; import JenisPendaftaranChart from "@/components/charts/JenisPendaftaranChart";
import AsalDaerahChart from "@/components/charts/AsalDaerahChart"; import AsalDaerahChart from "@/components/charts/AsalDaerahChart";
import ProvinsiMahasiswaChart from "@/components/chartsDashboard/ProvinsiMahasiswaPieChart";
interface MahasiswaTotal { interface MahasiswaTotal {
total_mahasiswa: number; total_mahasiswa: number;
@@ -203,9 +204,12 @@ export default function DashboardPage() {
<div className="col-span-1"> <div className="col-span-1">
<JenisPendaftaranChart /> <JenisPendaftaranChart />
</div> </div>
<div className="col-span-2"> <div className="col-span-1">
<AsalDaerahChart /> <AsalDaerahChart />
</div> </div>
<div className="col-span-1">
<ProvinsiMahasiswaChart />
</div>
</div> </div>
</> </>
) )

View File

@@ -255,9 +255,9 @@ export default function AsalDaerahChart() {
// Calculate dynamic height based on number of kabupaten // Calculate dynamic height based on number of kabupaten
const calculateHeight = () => { const calculateHeight = () => {
const minHeight = 200; const minHeight = 100;
const barHeight = 25; // Height per bar in pixels const barHeight = 15; // Height per bar in pixels
const padding = 100; // Extra space for title, legend, etc. const padding = 50; // Extra space for title, legend, etc.
const dynamicHeight = Math.max(minHeight, (data.length * barHeight) + padding); const dynamicHeight = Math.max(minHeight, (data.length * barHeight) + padding);
return `${dynamicHeight}px`; return `${dynamicHeight}px`;
}; };
@@ -271,7 +271,7 @@ export default function AsalDaerahChart() {
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<div <div
className="w-full max-w-5xl mx-auto" className="w-full max-w-xl mx-auto"
style={{ height: calculateHeight() }} style={{ height: calculateHeight() }}
> >
<Chart <Chart