vue-chartjs icon indicating copy to clipboard operation
vue-chartjs copied to clipboard

Legacy multiple annotations

Open kidGodzilla opened this issue 3 years ago • 2 comments

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.


  • [x] All tests passed

Environment

  • OS: macOS Monterey
  • NPM Version: 8.10.0

kidGodzilla avatar Aug 22 '22 23:08 kidGodzilla

CI Test failures seem unrelated to my changes

kidGodzilla avatar Aug 24 '22 19:08 kidGodzilla

@kidGodzilla Hi. Thank you for the PR!

Please pull changes from main to fix CI.

dangreen avatar Sep 02 '22 09:09 dangreen