mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 23:35:45 +00:00
fix(FE): fixing line chart dashboard comparison
This commit is contained in:
@@ -659,44 +659,50 @@ const DashboardLineChart = ({
|
|||||||
seriesData = comparisonChart?.series || [];
|
seriesData = comparisonChart?.series || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return seriesData
|
return seriesData.map((series, originalIndex) => {
|
||||||
.filter((series) => visibleSeries.has(series.id))
|
// Skip rendering if series is not visible
|
||||||
.map((series, index) => {
|
if (!visibleSeries.has(series.id)) {
|
||||||
const isStandard = series.id
|
return null;
|
||||||
.toString()
|
}
|
||||||
.toLowerCase()
|
|
||||||
.includes('std');
|
|
||||||
// Use series.id directly as dataKey to match dataset fields
|
|
||||||
const dataKey = series.id.toString();
|
|
||||||
|
|
||||||
return (
|
const isStandard = series.id
|
||||||
<Line
|
.toString()
|
||||||
key={`${series.id}--${index}`}
|
.toLowerCase()
|
||||||
type='monotone'
|
.includes('std');
|
||||||
dataKey={dataKey}
|
const dataKey = series.id.toString();
|
||||||
name={series.label}
|
|
||||||
stroke={getLineColor(series.id, index, analysisMode)}
|
return (
|
||||||
opacity={isStandard ? 0.5 : 1}
|
<Line
|
||||||
strokeWidth={2}
|
key={`${series.id}--${originalIndex}`}
|
||||||
strokeDasharray={isStandard ? '5 5' : undefined}
|
type='monotone'
|
||||||
dot={
|
dataKey={dataKey}
|
||||||
isStandard
|
name={series.label}
|
||||||
? false
|
stroke={getLineColor(
|
||||||
: {
|
series.id,
|
||||||
r: 3,
|
originalIndex,
|
||||||
fill: '#fff',
|
analysisMode
|
||||||
stroke: getLineColor(
|
)}
|
||||||
series.id,
|
opacity={isStandard ? 0.5 : 1}
|
||||||
index,
|
strokeWidth={2}
|
||||||
analysisMode
|
strokeDasharray={isStandard ? '5 5' : undefined}
|
||||||
),
|
dot={
|
||||||
strokeWidth: 2,
|
isStandard
|
||||||
}
|
? false
|
||||||
}
|
: {
|
||||||
activeDot={isStandard ? undefined : { r: 5 }}
|
r: 3,
|
||||||
/>
|
fill: '#fff',
|
||||||
);
|
stroke: getLineColor(
|
||||||
});
|
series.id,
|
||||||
|
originalIndex,
|
||||||
|
analysisMode
|
||||||
|
),
|
||||||
|
strokeWidth: 2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
activeDot={isStandard ? undefined : { r: 5 }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
});
|
||||||
})()}
|
})()}
|
||||||
</LineChart>
|
</LineChart>
|
||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user