Chartjs-Chart.js โ€“ Show new data on button click

1๐Ÿ‘

โœ…

You have to change data directly in chart object and then call update method of this object :

$('#btn-next').click(function () {
  chart.data.datasets[0].data = workedHoursData.splice(0, counter);
  chart.update();
  counter += counter;
});

Leave a comment