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

[Bug]: Multichart in same page only loads one #801

Closed
1 task
DanyDes opened this issue Apr 5, 2022 · 11 comments
Closed
1 task

[Bug]: Multichart in same page only loads one #801

DanyDes opened this issue Apr 5, 2022 · 11 comments

Comments

@DanyDes
Copy link

DanyDes commented Apr 5, 2022

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

I've been working with the library and when I needed to show multiple charts it did't work. I was using the 4.0.4 version then downgraded it to the version 4.0.3 and worked perfectly.

I just wanted to report it.

Reproduction

https://codesandbox.io/s/optimistic-hill-nc0h95?file=/src/App.vue

chart.js version

3.7.1

vue-chartjs version

4.0.4

Possible solution

No response

@edwardsph
Copy link

Thank you for raising this. I just upgraded from 3.5.1 to 4.0.4 and had the same problem. I would never have guessed to downgrade to 4.0.3.

thabarbados added a commit that referenced this issue Apr 6, 2022
fix the error, when multiple charts can't render on one page

fix #800 #801
thabarbados added a commit that referenced this issue Apr 7, 2022
fix the error, when multiple charts can't render on one page

fix #800 #801
dangreen pushed a commit that referenced this issue Apr 7, 2022
* fix(legacy-charts): fix render multiple charts at one page

fix the error, when multiple charts can't render on one page

fix #800 #801

* fix: change syntax
@thabarbados
Copy link
Collaborator

@DanyDes @edwardsph fixed in 4.0.5
You can check here

@akhchan99
Copy link

akhchan99 commented Apr 8, 2022

If you make the chart data reactive, then only the last chart will update and shown (with 4.0.5)

@tttaisgt
Copy link

tttaisgt commented Apr 9, 2022

@thabarbados

    "chart.js": "^3.7.1",
    "vue": "^2.6.14",
    "vue-chartjs": "^4.0.5",

it works perfectly in the first render, but when I change the data of one chart, the rest charts will disappear, like this:
image
😢

@thabarbados thabarbados reopened this Apr 9, 2022
@thabarbados
Copy link
Collaborator

@tttaisgt Can you repo this bug on the sandbox?

@tttaisgt
Copy link

tttaisgt commented Apr 9, 2022

@thabarbados
I have no experience with the sandbox environment 😓 , I tried to reproduce it but the phenomenon of

If you make the chart data reactive, then only the last chart will update and shown (with 4.0.5)

occurs
the sandbox URL: https://codesandbox.io/s/pedantic-tharp-moi7lj?file=/src/App.vue

In my case, the code is similar to the URL above, the phenomenon of chart disappearing occurs, please see the video:

Screen.Recording.2022-04-10.at.00.27.37.mov

@hoduyquang75
Copy link

@thabarbados
Cc: @tttaisgt
I have the same problem as above. 😢 😭

@thabarbados
Copy link
Collaborator

@akhchan99 @tttaisgt @hoduyquang75 I am trying to fix this bug. Until I do this, you can downgrade to version 4.0.3.

@ShacharMeir007
Copy link

@thabarbados I think I have a solution for this bug, at least it worked when I tested it. Is there a way for me to push my changes?

@thabarbados
Copy link
Collaborator

@ShacharMeir007 Sounds great!
You can fork the project, make changes and create a PR. Or you can put your code on codesandbox and send the link here.

thabarbados added a commit that referenced this issue Apr 20, 2022
Fix bug updating multiple reactive charts on one page, except when using the
chartjs-plugin-annotation and Vue 2 simultaneously.

#801
@thabarbados
Copy link
Collaborator

thabarbados commented Apr 21, 2022

Fixed in release 4.0.6, except for using Vue 2 and chartjs-plugin-annotation simultaneously.
Added a paragraph about this to the docs

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

Successfully merging a pull request may close this issue.

8 participants