First and Last Points joining on re-render
Hi,
I am trying to draw a line graph. The issue is, on re-render first and the last point gets joined. This looks like unexpected behavior. I have added an image of the same.
Thanks
Can you upload your dataset as well?
Thanks!
The dataset is dynamically generated. Below given is current graph and dataset:
datasets = [ { "data": [ { "x": 17, "y": "8809.22" }, { "x": 18, "y": "7872.22" }, { "x": 19, "y": "7479.22" }, { "x": 20, "y": "5271.26" }, { "x": 21, "y": "302.26" }, { "x": 22, "y": "209.26" }, { "x": 29, "y": "32965.26" }, { "x": 2, "y": "24965.26" }, { "x": 4, "y": "24865.26" }, { "x": 6, "y": "24695.26" }, { "x": 9, "y": "9423.26" }, { "x": 11, "y": "8178.26" }, { "x": 13, "y": "10495.70" }, { "x": 14, "y": "10383.70" }, { "x": 16, "y": "10383.70" } ], "label": [], "fill": true, "lineTension": 0.2, "backgroundColor": "transparent", "borderWidth": 1.5, "borderColor": "#afafaf", "borderCapStyle": "round", "borderDash": [], "borderDashOffset": 0, "borderJoinStyle": "round", "pointBackgroundColor": [ "#e21f2b", "#e21f2b", "#e21f2b", "#e21f2b", "#e21f2b", "#e21f2b", "#06b08a", "#e21f2b", "#e21f2b", "#e21f2b", "#e21f2b", "#e21f2b", "#06b08a", "#e21f2b", "#06b08a" ], "pointBorderColor": "#fff", "pointBorderWidth": 0, "pointHoverRadius": 6, "pointHoverBorderColor": "rgba(220,220,220,1)", "pointHoverBorderWidth": 2, "pointRadius": 6, "pointHitRadius": 10 } ]
Sorry, my bad. I was appending data to old dataset before clearing it.
BTW I have a question not related to this library. How can we (deep) clone a raw javascript object?
https://lodash.com/docs/4.17.4#cloneDeep is what you're probably looking for. :)