Change total mahasiswa

This commit is contained in:
Randa Firman Putra
2025-06-24 00:50:02 +07:00
parent fadca46dc1
commit eb7c884c41
19 changed files with 569 additions and 138 deletions

View File

@@ -203,6 +203,23 @@ export default function NamaBeasiswaChart({ selectedYear, selectedJenisBeasiswa
const series = processSeriesData();
// Calculate the maximum value from all series for y-axis padding
const maxValue = Math.max(
...series.flatMap(s => s.data)
);
// Add 20% padding to the maximum value
const yAxisMax = Math.ceil(maxValue * 1.2);
// Update chart options with y-axis max
const updatedChartOptions: ApexOptions = {
...chartOptions,
yaxis: {
...chartOptions.yaxis,
max: yAxisMax
}
};
if (loading) {
return (
<Card className="bg-white dark:bg-slate-900 shadow-lg">
@@ -251,7 +268,7 @@ export default function NamaBeasiswaChart({ selectedYear, selectedJenisBeasiswa
<div className="h-[400px] sm:h-[350px] md:h-[400px] w-full max-w-5xl mx-auto">
{typeof window !== 'undefined' && series.length > 0 && (
<Chart
options={chartOptions}
options={updatedChartOptions}
series={series}
type="bar"
height="100%"