Chartjs-Angular 2+: How to load a data to chartjs graph in every second in Angular

1👍

You need to push the new data to the following array,

this.chart.data.datasets.push(yournewObject);

and you can refresh the chart by using

  this.interval = setInterval(() => { 
        this.buildChart(); 
    }, 5000);

make sure to declare interval of type any

Leave a comment