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

Feature Request: property that allows the hiding of labels if they cannot visibly fit within the width/height of the bar. #367

Open DaveCole opened 1 year ago

DaveCole commented 1 year ago

When using a stacked horizontal bar chart, there are many cases where a label from one bar overlaps another, which can be misleading and visually unappealing. It would be really nice to have an option that detected this and hid the offending label. Bonus points if one could invert the colors of a label if it fell outside of the bar at the end of the stack.

getify commented 9 months ago

Seems like display: 'auto' might work here?

https://chartjs-plugin-datalabels.netlify.app/guide/positioning.html#visibility