'key' issue in Line graph with null values in data
See original GitHub issueCommit #81 was intended to enable linecharts with missing data points (nulls). It works but there are certain conditions that create duplicate keys which leads to a lot of these errors:
Because of the flattening of children the line between dots is not being drawn even though it should.
If animate={true} there is a ‘runaway’ error condition and errors go into the thousands within seconds, with animate={false} errors only occur on prop change.
Again, it only happens if multiple lines are drawn i.e.
[ { id: 19, data: [{x: ....., y: .....}, .....], {id: 30. data: [....]} ]
I’m fairly certain I’m passing the correct props and I believe that passing null as certain y’s leads to the duplicate key issue.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
I have found a difference of
x
values in your data. For example item with value{ x: "10-10-00", y: <any value> }
exist in the first collection, but was missed in the second one.How I understand the ideology of the library, dataset for each
Line
should have the same length and should consist of the identical sets ofx
values.Wrong (your case):
Correct:
So, you should fill missed values of
x
in each dataset with{ "x": <missed value>, "y": null }
.@plouc, correct me, please.
@ahtohbi4, you’re right 👍, thank you!