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

Legacy multiple annotations #910

Merged
merged 3 commits into from Sep 26, 2022

Conversation

kidGodzilla
Copy link
Contributor

Fix or Enhancement?

Resolves #909 – Multiple instances of a chart cannot be rendered at once if using the Annotations plugin

Extends the _chartRef object to handle multiple instances of vue-chartjs wrapper components, in Vue 2, when the annotations plugin is present. Assigns a unique, random ID to each one.

Sandboxes

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

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


Feel free to suggest improvements. I believe most of #818 could be factored out to treat this state management the same, even when the annotations plugin is not present, removing the computed property & $data._chart.


  • All tests passed

Environment

  • OS: macOS Monterey
  • NPM Version: 8.10.0

Handle multiple instances of a `vue-chartjs` wrapper component when the annotations plugin is in use
@kidGodzilla
Copy link
Contributor Author

kidGodzilla commented Aug 24, 2022

CI Test failures seem unrelated to my changes

@dangreen
Copy link
Collaborator

dangreen commented Sep 2, 2022

@kidGodzilla Hi. Thank you for the PR!

Please pull changes from main to fix CI.

@dangreen dangreen merged commit 2a20eb8 into apertureless:main Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants