Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't display mltiple charts on one page. #32

Open
Gregor-code opened this issue Oct 30, 2022 · 0 comments
Open

Can't display mltiple charts on one page. #32

Gregor-code opened this issue Oct 30, 2022 · 0 comments

Comments

@Gregor-code
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant