fix: victory groups order
This commit is contained in:
parent
cf8d79b8e4
commit
fa57a78cb9
|
@ -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] }))}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user