reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

Removing old segments on update. #88

Closed cryptic-mystic closed 8 years ago

cryptic-mystic commented 8 years ago

So I was using the Doughnut Charts in this library, and thought it strange that some of my old data points remained after my component store updated. Turns out, if the new data array is shorter than the original, those segments are never replaced and remain. So I added a quick loop that removes old data segments from the chart. :) Lemme know what you think!

austinpray commented 8 years ago

Works great! Thank you!