I have a realization you may see on the screenshot. But this two separate lines is not connected to each other even if the end value of the first line is the same as start on the second line see the Chart
I’ve attached codesandbox realization I had made https://codesandbox.io/s/two-separate-lines-wet8f9
I have created two separate components with different data objects. The first one doesn’t contain the data from the second line
2
Answers
The only answer for myself I figured out during some experiments https://codesandbox.io/s/two-separate-lines-forked-lmjlzy?file=/src/App.tsx
If you have more apropriate solution, it would be great to see it
You’re not using the correct data array. Each object in
data
renders a point in the chart. However, yourmergedData
duplicates Page E.So the chart renders 2 different points in X with the same name.
What you want is a single point with both
pv
andpv2
values:Sidenote: for clarity you can remove
uv
andamt
since there are noLine
assigned for thosedata-key
.