1👍
✅
According to the Chart.js documentation you can update your graph with something like this:
async function updateGraphWithData() {
const data = await apiCall(); // Your call to your backend
lineChart.data.datasets.forEach(dataset => {
dataset.data = data;
});
lineChart.update();
}
You need something which will trigger the function (like a button click) or something else.
Source:stackexchange.com