vue-charts
vue-charts copied to clipboard
Changing the options won't properly redraw the chart
If the options props
is changed the chart is redrawn, however the changes in the options are not reflected in the redrawn chart because the draw
method on the ChartWrapper
is using the old options instance.
I guess a fix would be to call chartWrapper.setOptions
(see docs) when the chart is redrawn or the options props is changed
have you handled a workaround for this?
My workaround is to substitude original component with an extended:
import Chart from 'vue-charts/src/components/chart'
export default Object.assign(Chart, {
watch: {
options() {
if (this.wrapper) {
this.wrapper.setOptions(this.options)
}
}
}
});