mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-26 00:05:45 +00:00
Merge branch 'fix/dashboard' into 'development'
[FIX/FE] Fixing Line Chart in Dashboard Page See merge request mbugroup/lti-web-client!302
This commit is contained in:
@@ -67,7 +67,7 @@ const lineColors: Record<string, string> = {
|
||||
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',
|
||||
@@ -659,23 +659,29 @@ const DashboardLineChart = ({
|
||||
seriesData = comparisonChart?.series || [];
|
||||
}
|
||||
|
||||
return seriesData
|
||||
.filter((series) => visibleSeries.has(series.id))
|
||||
.map((series, index) => {
|
||||
return seriesData.map((series, originalIndex) => {
|
||||
// Skip rendering if series is not visible
|
||||
if (!visibleSeries.has(series.id)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const isStandard = series.id
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.includes('std');
|
||||
// Use series.id directly as dataKey to match dataset fields
|
||||
const dataKey = series.id.toString();
|
||||
|
||||
return (
|
||||
<Line
|
||||
key={`${series.id}--${index}`}
|
||||
key={`${series.id}--${originalIndex}`}
|
||||
type='monotone'
|
||||
dataKey={dataKey}
|
||||
name={series.label}
|
||||
stroke={getLineColor(series.id, index, analysisMode)}
|
||||
stroke={getLineColor(
|
||||
series.id,
|
||||
originalIndex,
|
||||
analysisMode
|
||||
)}
|
||||
opacity={isStandard ? 0.5 : 1}
|
||||
strokeWidth={2}
|
||||
strokeDasharray={isStandard ? '5 5' : undefined}
|
||||
@@ -687,7 +693,7 @@ const DashboardLineChart = ({
|
||||
fill: '#fff',
|
||||
stroke: getLineColor(
|
||||
series.id,
|
||||
index,
|
||||
originalIndex,
|
||||
analysisMode
|
||||
),
|
||||
strokeWidth: 2,
|
||||
|
||||
@@ -66,7 +66,7 @@ const lineColors: Record<string, string> = {
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user