You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
+1 on this, I am having the same problem. Radar chart is the whole reason i'm using this library so if I can't get it to work I will have to replace it :(
I passed in redraw as a prop and it fixed the issue for me. It scraps the old chart and makes a whole new one every time though. For example, your code would look like this:
Hey guys, I was having an issue with my doughnut charts updating (which shares code with radar and circle charts). Old data points would not be removed when the new dataset was of a smaller length than the previous. I've made a PR under #88, if you think it might help your problems we can make an effort to get it merged.
Ok, so #88 does not fix the issue. #88 just applies to Polar/Pie/Doughnut Charts. However, chart.removeData() seemed promising. I mucked around with it a bit and removed the while loop just below the change in #88.
This of course causes some other errors but I just added a few extra if statements to classData.componentWillReceiveProps:
if (chart.scale) { chart.scale.xLabels = nextProps.data.labels; if (chart.scale.calculateXLabelRotation){ chart.scale.calculateXLabelRotation(); } }
Now, my radar chart is updating without redrawing. This feels like a bit of a hack, so I want to poke at it a bit more before submitting a pull request.
@lauffenp Yeah my commit only related to those charts you mentioned. I noticed that some of my charts have been updating slowly with my fix, so if you're able to remove the data without a loop that'll probably give us a speed boost.
Activity
blizzo521 commentedon Feb 26, 2016
+1 on this, I am having the same problem. Radar chart is the whole reason i'm using this library so if I can't get it to work I will have to replace it :(
pardhaponugoti commentedon Mar 15, 2016
I passed in redraw as a prop and it fixed the issue for me. It scraps the old chart and makes a whole new one every time though. For example, your code would look like this:
`
I saw it at the bottom of this page:
https://github.com/jhudson8/react-chartjs
phil-lauffenburger commentedon Mar 15, 2016
Yeah, that works for me as well. I just don't like how redrawing the chart looks.
rossPatton commentedon Mar 22, 2016
adding to this.
redrawfixes the issue for me as well, but it shouldn't really be neededcryptic-mystic commentedon Mar 23, 2016
Hey guys, I was having an issue with my doughnut charts updating (which shares code with radar and circle charts). Old data points would not be removed when the new dataset was of a smaller length than the previous. I've made a PR under #88, if you think it might help your problems we can make an effort to get it merged.
austinpray commentedon Mar 27, 2016
Can you guys check if #88 fixed your issue?
phil-lauffenburger commentedon Mar 29, 2016
Ok, so #88 does not fix the issue. #88 just applies to Polar/Pie/Doughnut Charts. However, chart.removeData() seemed promising. I mucked around with it a bit and removed the while loop just below the change in #88.
} else { chart.removeData(); nextProps.data.datasets.forEach(function(set, setIndex) {This of course causes some other errors but I just added a few extra if statements to classData.componentWillReceiveProps:
if (chart.scale) { chart.scale.xLabels = nextProps.data.labels; if (chart.scale.calculateXLabelRotation){ chart.scale.calculateXLabelRotation(); } }Now, my radar chart is updating without redrawing. This feels like a bit of a hack, so I want to poke at it a bit more before submitting a pull request.
Any thoughts?
cryptic-mystic commentedon Mar 29, 2016
@lauffenp Yeah my commit only related to those charts you mentioned. I noticed that some of my charts have been updating slowly with my fix, so if you're able to remove the data without a loop that'll probably give us a speed boost.
phil-lauffenburger commentedon Mar 31, 2016
#92 should fix this.
phil-lauffenburger commentedon Apr 1, 2016
fixed by #92