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]: Known issue: Multiple instances of a chart cannot be rendered at once if using the Annotations plugin (Legacy) #909

Closed
1 task done
kidGodzilla opened this issue Aug 22, 2022 · 0 comments · Fixed by #910

Comments

@kidGodzilla
Copy link
Contributor

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

#818 adds specific behavior to work around the annotations plugin, that prevents multiple instances of the vue-chartjs wrapper component from being rendered at the same time, if the annotations plugin is present.

I'm testing this inside a more complex project using patch-package, another issue is that, when using the annotations, chartOptions reactivity is broken. It will always update the last instance of chart.js rendered.

Reproduction

https://codesandbox.io/s/practical-bas-2irrtp

chart.js version

v3.8.0

vue-chartjs version

v4.1.1

Possible solution

I have a PR which fixes the issue by allowing multiple instances of the chartjs component, albeit there is an opportunity to factor out some of #818 as well (remove $data._chart & all computed properties)

Reproduces the issue with annotation plugin (multiple instances): https://codesandbox.io/s/practical-bas-2irrtp

Fixes the issue with updated compiled vue-chartjs: https://codesandbox.io/s/twilight-feather-ymgud6

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

Successfully merging a pull request may close this issue.

1 participant