chartjs / chartjs-plugin-datalabels

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

Issue with positioning of Label in Donut Chart if only one series is enabled #338

Open yarykstus opened 1 year ago

yarykstus commented 1 year ago

In mine chart i have few values. It positioning perfectly! but once user disabled all of the values except one - label jumps to the edge of the series, not to the center of it image on this screenshot series 12-18, 19,24, 25-40 and 65+ has 0es. and oly 41-64 has value (10)

Plugin setup is datalabels: { display: true, color: '#fff', font: { weight: 500, size: 15, family: 'Poppins', }, anchor: 'center', formatter: (value: number) => { return value || ''; }, },