0👍
I looks like you’re creating new charts within the same canvas
each time the data changes. You should better create the chart once only and then update its data.labels
, data.datasets.data
and options.title
each time the data for other cities are available. After all data
and options
are updated, you need to invoke myChart.update()
.
Please take a look at the following answers that deal with similar issues:
- Chartjs-How can I hide points on chart?
- Chartjs-ReactJs: componentWillReceiveProps doesn't get called for component whose redux action gets dispatched last
Source:stackexchange.com