When one chart is rendered via their rendering-function
(e.g. function createChart() { let ctx = document.getElementById("barChart"); let myChart = new Chart(ctx, { type: "bar", data: chartData, options: chartOptions, }); })
You can't render a second one by creating the same chart component at index.svelte.
The canvas gets created but the chart does not get displayed on it.
Maybe the solution will be to create a canvas with a new class name each time the bar chart component is rendered.
When one chart is rendered via their rendering-function
(e.g.
function createChart() { let ctx = document.getElementById("barChart"); let myChart = new Chart(ctx, { type: "bar", data: chartData, options: chartOptions, }); })You can't render a second one by creating the same chart component at index.svelte.
The canvas gets created but the chart does not get displayed on it.
Maybe the solution will be to create a canvas with a new class name each time the bar chart component is rendered.