Fix Bug For Asal Daerah Charts
This commit is contained in:
@@ -141,7 +141,6 @@ export default function AsalDaerahBeasiswaChart({ selectedYear, selectedJenisBea
|
||||
},
|
||||
maxWidth: 200,
|
||||
},
|
||||
tickAmount: undefined,
|
||||
},
|
||||
grid: {
|
||||
padding: {
|
||||
|
||||
@@ -98,7 +98,6 @@ export default function AsalDaerahLulusChart({ selectedYear }: AsalDaerahLulusCh
|
||||
},
|
||||
maxWidth: 200,
|
||||
},
|
||||
tickAmount: undefined,
|
||||
},
|
||||
grid: {
|
||||
padding: {
|
||||
|
||||
@@ -114,7 +114,6 @@ export default function AsalDaerahPerAngkatanChart({ tahunAngkatan }: Props) {
|
||||
},
|
||||
maxWidth: 200,
|
||||
},
|
||||
tickAmount: undefined,
|
||||
},
|
||||
grid: {
|
||||
padding: {
|
||||
@@ -228,18 +227,11 @@ export default function AsalDaerahPerAngkatanChart({ tahunAngkatan }: Props) {
|
||||
data: jumlah
|
||||
}]);
|
||||
|
||||
// Calculate the maximum value from data
|
||||
const maxValue = Math.max(...jumlah);
|
||||
|
||||
// Add 10% padding to the maximum value
|
||||
const xAxisMax = Math.ceil(maxValue * 1.1);
|
||||
|
||||
setOptions(prev => ({
|
||||
...prev,
|
||||
xaxis: {
|
||||
...prev.xaxis,
|
||||
categories: kabupaten,
|
||||
max: xAxisMax
|
||||
},
|
||||
chart: {
|
||||
...prev.chart,
|
||||
|
||||
@@ -141,7 +141,6 @@ export default function AsalDaerahPrestasiChart({ selectedYear, selectedJenisPre
|
||||
},
|
||||
maxWidth: 200,
|
||||
},
|
||||
tickAmount: undefined,
|
||||
},
|
||||
grid: {
|
||||
padding: {
|
||||
|
||||
Reference in New Issue
Block a user