You must be logged in to post your query.
Home › Forums › Chart Support › Chart update on button click in Angular
Hello,
I have a problem with updating a chart on button click in Angular. Here is an example. https://canvasjs-angular-column-chart-o3zmxt.stackblitz.io
Firstly, the dataPoints array is empty and on button click I would like to populate it and to update the chart, but it doesn’t work.
Could you please help me with this issue?
Thank you, Raluca
Raluca,
In order to update chart, you need to either change chart-options and call render or use set method. In your case, updating dataPoints through chart-options seems to be working fine. Please take a look at this updated stackblitz code.
— Vishwas R Team CanvasJS
Your solution works fine for me. Thanks for your response Vishwas! :)
You must be logged in to reply to this topic. Login/Register