Chartjs-Create multiple pie chart simultaneously using chart.js

1👍

Just solved the problem by calling a delay function before generating charts:

function sleep(ms) {
    return new Promise(create_chart => setTimeout(create_chart, ms));
}
async function demo() {
    await sleep(2000);
}

And in create_chart function:

demo();
new Chart(ctx2, config);

Leave a comment