score:1

Accepted answer

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.


Related Query

More Query from same tag