From 12c7e566048e03aacd03ec1e7e9a9fee4a327dcb Mon Sep 17 00:00:00 2001 From: randy-ar Date: Tue, 3 Feb 2026 11:45:33 +0700 Subject: [PATCH 1/2] fix(FE): fixing line chart dashboard --- src/components/pages/dashboard/chart/DashboardLineChart.tsx | 2 +- src/components/pages/dashboard/export/DashboardExportCharts.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/pages/dashboard/chart/DashboardLineChart.tsx b/src/components/pages/dashboard/chart/DashboardLineChart.tsx index 58749cf2..7b8d35a1 100644 --- a/src/components/pages/dashboard/chart/DashboardLineChart.tsx +++ b/src/components/pages/dashboard/chart/DashboardLineChart.tsx @@ -67,7 +67,7 @@ const lineColors: Record = { act_fcr: '#10B981', std_fcr: '#10B981', act_fcr_cum: '#F52419', - std_fcr_cum: '#10B981', + std_fcr_cum: '#F52419', normal: '#10B981', abnormal: '#F52419', act_deplesi: '#10B981', diff --git a/src/components/pages/dashboard/export/DashboardExportCharts.tsx b/src/components/pages/dashboard/export/DashboardExportCharts.tsx index ba0b2fe2..3281dbf8 100644 --- a/src/components/pages/dashboard/export/DashboardExportCharts.tsx +++ b/src/components/pages/dashboard/export/DashboardExportCharts.tsx @@ -66,7 +66,7 @@ const lineColors: Record = { act_fcr: '#10B981', std_fcr: '#10B981', act_fcr_cum: '#F52419', - std_fcr_cum: '#10B981', + std_fcr_cum: '#F52419', normal: '#10B981', abnormal: '#F52419', act_deplesi: '#10B981', From 0febc9d8f31b30529c6f19f77a686778eaa3a466 Mon Sep 17 00:00:00 2001 From: randy-ar Date: Tue, 3 Feb 2026 12:41:22 +0700 Subject: [PATCH 2/2] fix(FE): fixing line chart dashboard comparison --- .../dashboard/chart/DashboardLineChart.tsx | 80 ++++++++++--------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/src/components/pages/dashboard/chart/DashboardLineChart.tsx b/src/components/pages/dashboard/chart/DashboardLineChart.tsx index 7b8d35a1..bfb13d9a 100644 --- a/src/components/pages/dashboard/chart/DashboardLineChart.tsx +++ b/src/components/pages/dashboard/chart/DashboardLineChart.tsx @@ -659,44 +659,50 @@ const DashboardLineChart = ({ seriesData = comparisonChart?.series || []; } - return seriesData - .filter((series) => visibleSeries.has(series.id)) - .map((series, index) => { - const isStandard = series.id - .toString() - .toLowerCase() - .includes('std'); - // Use series.id directly as dataKey to match dataset fields - const dataKey = series.id.toString(); + return seriesData.map((series, originalIndex) => { + // Skip rendering if series is not visible + if (!visibleSeries.has(series.id)) { + return null; + } - return ( - - ); - }); + const isStandard = series.id + .toString() + .toLowerCase() + .includes('std'); + const dataKey = series.id.toString(); + + return ( + + ); + }); })()}