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
[Bug]: Generating charts in for loop not working as expected #800
Comments
This is happening to me too having two charts on the same page. I scoured through the documentation trying to figure out if I missed something and couldn't find anything obvious. |
Have you tried passing a unique |
I did, yes |
Here's some more info if it helps: Edit: I can pare it down to just the chart-data and chart-id and still happens with two charts on the same page.
Second:
In developer tools I can see both 'canvas' elements have different IDs:
For some reason the width of the first one doesn't get set also (viewport is 920). |
Hi @thabarbados -- thanks, I've copied what you've done and moved it over to recreate the issue. Looks like it might be 'legacy'/vue 2 related. |
Would you like to work on a fix?
Current and expected behavior
When generating a list of graphs in a for loop, only the very last one is being generated.
In the above the ChartLine component implements the LineChart below, but only the very last graph is generated and displayed, this was working in version 3.5.12 but not anymore. Below is my template for the chart.
Reproduction
https://codesandbox.io/s/distracted-currying-jq6bh1?file=/src/App.vue
chart.js version
v3.7.1
vue-chartjs version
v4.0.4
Possible solution
No response
The text was updated successfully, but these errors were encountered: