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

@@ -141,7 +141,7 @@ export default function TingkatPrestasiChart({ selectedJenisPrestasi }: Props) {
axisTicks: {
show: true,
color: theme === 'dark' ? '#374151' : '#E5E7EB'
}
},
},
yaxis: {
title: {
@@ -161,7 +161,8 @@ export default function TingkatPrestasiChart({ selectedJenisPrestasi }: Props) {
axisBorder: {
show: true,
color: theme === 'dark' ? '#374151' : '#E5E7EB'
}
},
tickAmount: 5,
},
fill: {
opacity: 1
@@ -202,23 +203,6 @@ export default function TingkatPrestasiChart({ 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">
@@ -266,7 +250,7 @@ export default function TingkatPrestasiChart({ selectedJenisPrestasi }: Props) {
<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={updatedChartOptions}
options={chartOptions}
series={series}
type="bar"
height="100%"