vue-chartjs
vue-chartjs copied to clipboard
[Bug]: Pie Chart custom tooltip label callback not firing on first load
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
When the chart first loads it shows the standard label despite a custom pie tooltip being passed. If I modify the Vue component and save, the HMR / reload triggers the label to work as expected.
Things I've tried:
- initializing the data / Chart in every Vue lifecycle hook
- updating the
chartDatato try triggering a reload - updating the ChartJs overrides after registering the elements
- a bunch of other random attempts to fix
Video (takes a few seconds for HMR to hit)

Reproduction
https://codesandbox.io/s/vue2-pie-chartjs-repro-y6kjrr?file=/src/components/Pie.vue
chart.js version
3.8.0
vue-chartjs version
4.1.1
Possible solution
No response
Hi @madebycaliper 👋
Have you tried just passing the tooltip options to chartOptions.plugins? I've modified the original example to do it this way and it seems to be working just as expected (here's a link to code sandbox).