Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Expose _labelItems for use by plugins

Open cmcnulty opened this issue 3 years ago • 0 comments

Feature Proposal

Proposal: expose _labelItems as publicly supported property: labelItems with new type LabelItem[]

Currently there is no supported way of retrieving the dimension of axis labels for the purpose of creating interactions or other customizations. A search of the discussions shows the use of _labelItems by several people to make various changes, but these are subject to future breakage. Here's my own example:

https://codepen.io/cmcnulty/pen/JjZPxmJ (hover over the x-axis labels to see a tooltip)

This feature would expose labelItems and add it to the documentation as a supported means of retrieving label dimensions.

Possible Implementation

PR incoming

cmcnulty avatar Oct 27 '22 14:10 cmcnulty