bugfixing

This commit is contained in:
MuslemRahimi 2025-01-09 11:36:23 +01:00
parent a4076d14c1
commit f2763c6e32

View File

@ -15,7 +15,6 @@
import { CanvasRenderer } from "echarts/renderers";
export let data;
use([
LineChart,
GaugeChart,
@ -57,9 +56,7 @@
while (year > 0) {
// Ensure we don't loop indefinitely
// Find the index where the item's date matches the current year and revenue is null
const index = data?.findIndex(
(item) => item?.date === year && item?.revenue === null,
);
const index = data?.findIndex((item) => item?.date === year);
// If index is found and there is at least one item in the data for this year with non-null revenue
if (index !== -1) {