Home forums Chart Support Chart update on button click in Angular

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32133

    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

    #32140

    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

    #32150

    Your solution works fine for me. Thanks for your response Vishwas! :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.