Change total mahasiswa
This commit is contained in:
@@ -214,6 +214,23 @@ export default function TotalPrestasiChart({ selectedJenisPrestasi }: Props) {
|
||||
|
||||
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">
|
||||
@@ -261,7 +278,7 @@ export default function TotalPrestasiChart({ selectedJenisPrestasi }: Props) {
|
||||
<div className="h-[300px] 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%"
|
||||
|
||||
Reference in New Issue
Block a user