0๐
โ
By using pop I think you are removing the last element in the list and not the oldest one. So after 60 seconds, only the last element will be updated and the older data will remain.
Use splice to remove the first element of the array in the removeChart
function removeData( chart, callback ) {
chart.data.labels.splice(0, 1);
chart.data.datasets.forEach((dataset) => {
dataset.data.splice(0, 1);
});
chart.update();
}
Source:stackexchange.com