Change Bug Charts
This commit is contained in:
@@ -105,7 +105,9 @@ export default function StatistikMahasiswaChart() {
|
||||
fontSize: '12px',
|
||||
colors: '#000'
|
||||
}
|
||||
}
|
||||
},
|
||||
min:0,
|
||||
tickAmount: 5
|
||||
}
|
||||
],
|
||||
fill: {
|
||||
@@ -243,15 +245,6 @@ export default function StatistikMahasiswaChart() {
|
||||
// Update categories when data changes
|
||||
useEffect(() => {
|
||||
if (statistikData.length > 0) {
|
||||
// Calculate the maximum value from all series
|
||||
const maxValue = Math.max(
|
||||
...statistikData.map(item => item.total_mahasiswa),
|
||||
...statistikData.map(item => item.pria),
|
||||
...statistikData.map(item => item.wanita)
|
||||
);
|
||||
|
||||
// Add 50% padding to the maximum value
|
||||
const yAxisMax = Math.ceil(maxValue * 1.2);
|
||||
|
||||
setChartOptions(prev => ({
|
||||
...prev,
|
||||
@@ -262,7 +255,6 @@ export default function StatistikMahasiswaChart() {
|
||||
yaxis: [
|
||||
{
|
||||
...prev.yaxis[0],
|
||||
max: yAxisMax
|
||||
}
|
||||
]
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user