fix: victory groups order

This commit is contained in:
Vyacheslav Matyukhin 2022-05-07 01:28:42 +04:00
parent cf8d79b8e4
commit fa57a78cb9
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -269,13 +269,15 @@ export const HistoryChart: React.FC<Props> = ({ question }) => {
// tickFormat specifies how ticks should be displayed // tickFormat specifies how ticks should be displayed
tickFormat={(x) => `${x * 100}%`} tickFormat={(x) => `${x * 100}%`}
/> />
{ {[...Array(MAX_LINES).keys()]
dataSets .reverse() // affects svg render order, we want to render largest datasets on top of others
.map((dataSet, i) => .map((i) =>
getVictoryGroup({ data: dataSet, i, highlight: i === highlight }) getVictoryGroup({
) data: dataSets[i],
.reverse() // affects svg render order, we want to render largest datasets on top of others i,
} highlight: i === highlight,
})
)}
</VictoryChart> </VictoryChart>
<Legend <Legend
items={dataSetsNames.map((name, i) => ({ name, color: colors[i] }))} items={dataSetsNames.map((name, i) => ({ name, color: colors[i] }))}