How to update charts reactively
masterThe chart automatically re-renders when the series or options props change.
Important: When updating nested properties within the options object, you must replace the entire options object (or the outermost property being changed) to ensure Vue's reactivity system detects the change. Do not attempt to mutate a nested property directly.
// ✅ Do this: Replace the whole object to trigger Vue watch
this.chartOptions = {
...this.chartOptions,
xaxis: {
labels: {
style: {
colors: ['red']
}
}
}
}
// ❌ Not this: Direct mutation of nested property will not trigger update
this.chartOptions.xaxis = {
labels: {
style: {
colors: ['red']
}
}
}