Home Forums Chart Support Update

Update

Viewing 2 posts - 1 through 2 (of 2 total)
  • #45792

    Hi

    I would like to know how I can update data when using the chats like this
    <canvasjs-chart [options]=”chartOptions”></canvasjs-chart>
    chartOptions = {
    title: {
    text: ‘Basic Column Chart in Angular’,
    },
    data: [
    {
    type: ‘column’,
    dataPoints: [],
    },
    ],
    };

    I am able to go the <div id=”chartContainer” style=”height: 370px; width: 100%; margin:auto;”></div> route using render() but would like to rather use it as above <canvasjs-chart [options]=”chartOptions”></canvasjs-chart> and then re-render the chart..

    PS I am using Angular18
    Is this possible ??
    Thanks
    Ernst Dettbarn

    #45800

    @netbal21,

    You can get a reference to the chart instance and use it to update the data. Please take a look at this StackBlitz for an example of the same. You can also take a look at this gallery page for more examples of dynamic charts.


    Ananya Deka
    Team CanvasJS

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

You must be logged in to reply to this topic.