You must be logged in to post your query.
Home › Forums › Chart Support › How to re-render when the dataPoints value changed in vuejs?
According to https://canvasjs.com/fdm/samples/vuejs-canvasjs-chart-samples/
When click the button ‘test’ the value was changed to ’40’ but the chart is not uppdated.
Updating datapoint value via chart option and re-rendering the chart seems to be working fine. To do so, you need to get the reference to the chart by passing the call-back function like @chart-ref="chartRef" to the component. Please refer to the code-snippet below.
// Getting Chart Reference
<CanvasJSChart :options="options" @chart-ref="chartRef" />
this.chart = chart;
// Updating Datapoint value
(item) => (item.label == 'apple')
).y = 40;
Please take a look at this updated Stackblitz for complete code.
You must be logged in to reply to this topic. Login/Register