Change Bug Charts

This commit is contained in:
Randa Firman Putra
2025-06-24 04:23:19 +07:00
parent 25812386cb
commit 39f16d6a5e
14 changed files with 45 additions and 293 deletions

View File

@@ -135,7 +135,9 @@ export default function JenisPendaftaranStatusChart({ selectedYear, selectedStat
fontSize: '12px',
colors: theme === 'dark' ? '#fff' : '#000'
}
}
},
min:0,
tickAmount: 5
},
fill: {
opacity: 1,
@@ -188,23 +190,6 @@ export default function JenisPendaftaranStatusChart({ selectedYear, selectedStat
const series = processSeriesData();
console.log('Processed series data:', series);
// 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">
@@ -253,7 +238,7 @@ export default function JenisPendaftaranStatusChart({ selectedYear, selectedStat
<div className="h-[350px] w-full max-w-5xl mx-auto">
{typeof window !== 'undefined' && (
<Chart
options={updatedChartOptions}
options={chartOptions}
series={series}
type="bar"
height="100%"