mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
fix(FE): fixing line chart dashboard comparison
This commit is contained in:
@@ -659,23 +659,29 @@ 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)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const isStandard = series.id
|
const isStandard = series.id
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes('std');
|
.includes('std');
|
||||||
// Use series.id directly as dataKey to match dataset fields
|
|
||||||
const dataKey = series.id.toString();
|
const dataKey = series.id.toString();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Line
|
<Line
|
||||||
key={`${series.id}--${index}`}
|
key={`${series.id}--${originalIndex}`}
|
||||||
type='monotone'
|
type='monotone'
|
||||||
dataKey={dataKey}
|
dataKey={dataKey}
|
||||||
name={series.label}
|
name={series.label}
|
||||||
stroke={getLineColor(series.id, index, analysisMode)}
|
stroke={getLineColor(
|
||||||
|
series.id,
|
||||||
|
originalIndex,
|
||||||
|
analysisMode
|
||||||
|
)}
|
||||||
opacity={isStandard ? 0.5 : 1}
|
opacity={isStandard ? 0.5 : 1}
|
||||||
strokeWidth={2}
|
strokeWidth={2}
|
||||||
strokeDasharray={isStandard ? '5 5' : undefined}
|
strokeDasharray={isStandard ? '5 5' : undefined}
|
||||||
@@ -687,7 +693,7 @@ const DashboardLineChart = ({
|
|||||||
fill: '#fff',
|
fill: '#fff',
|
||||||
stroke: getLineColor(
|
stroke: getLineColor(
|
||||||
series.id,
|
series.id,
|
||||||
index,
|
originalIndex,
|
||||||
analysisMode
|
analysisMode
|
||||||
),
|
),
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
|
|||||||
Reference in New Issue
Block a user