vue-chart-js
vue-chart-js copied to clipboard
How to update chart when data prop changes?
I've read through the discussions in the following issues but they did not help resolve my problem: https://github.com/kevinongko/vue-chart-js/issues/10, https://github.com/kevinongko/vue-chart-js/issues/7.
Here is an example on my issue on Code Sandbox: https://codesandbox.io/s/6w9mjky30w.
As you can see, I use buttons to change the data
prop that is passed to vue-chart
. The data is set to a new object if a different button is pressed, which is verified by the watcher I've set up.
If I'm passing a new data object to vue-chart
, why, then, does the chart not update?