reactjs / react-chartjs

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

Uncaught TypeError: Cannot set property 'xLabels' of undefined #20

Closed adamellsworth closed 9 years ago

adamellsworth commented 9 years ago

This pertains to the codebase on https://github.com/jhudson8/react-chartjs/pull/17

https://github.com/aaronhayes/react-chartjs/blob/master/lib/core.js#L45

Oddly, while it does update the chart with the pertinent labels, It's still throwing this error with no perceivable repercussions as new data is fed into the char.


In Firefox, instead of the xLabels error, I get:

TypeError: nextProps.data.labels is undefined
aaronhayes commented 9 years ago

ahh yes, forgot to mention there is an error in chart.js itself. It has been fixed in a recently merged pull on https://github.com/nnnick/Chart.js. However a release has not been made yet.

jhudson8 commented 9 years ago

closing this as it is not an issue with react-chartjs

kas commented 6 years ago

Adding redraw as a prop fixed this issue for me.

https://stackoverflow.com/a/48930199