chartjs / chartjs-plugin-datalabels

Chart.js plugin to display labels on data elements
https://chartjs-plugin-datalabels.netlify.app
MIT License
863 stars 459 forks source link

Labels disappear after chart update #359

Open Odrin opened 1 year ago

Odrin commented 1 year ago

Current behaviour

If only active points labels are displayed (display: (context) => context.active) and chart.update() triggered while some labels are displayed, these labels disappear until another point become active.

Expected behaviour

chart.update() don't breaks active points label visibility.

Steps to Reproduce

  1. Open example (https://codesandbox.io/s/plugin-example-forked-7ntsoq?file=/src/App.vue)
  2. Hover on any point
  3. Wait until chart.update() trigger (5 sec)
  4. Labels disappear and appear again only after another point hovered

Environment

chart.js: 4.1.1 chartjs-plugin-datalabels: 2.2.0