Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose _labelItems for use by plugins #10836

Closed
cmcnulty opened this issue Oct 27, 2022 · 1 comment
Closed

Expose _labelItems for use by plugins #10836

cmcnulty opened this issue Oct 27, 2022 · 1 comment

Comments

@cmcnulty
Copy link
Contributor

cmcnulty commented Oct 27, 2022

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 added a commit to cmcnulty/Chart.js that referenced this issue Oct 28, 2022
cmcnulty added a commit to cmcnulty/Chart.js that referenced this issue Nov 2, 2022
cmcnulty added a commit to cmcnulty/Chart.js that referenced this issue Nov 2, 2022
cmcnulty added a commit to cmcnulty/Chart.js that referenced this issue Nov 2, 2022
cmcnulty added a commit to cmcnulty/Chart.js that referenced this issue Nov 2, 2022
@cmcnulty
Copy link
Contributor Author

cmcnulty commented Nov 3, 2023

Closed with #10966 - see documentation here:

https://www.chartjs.org/docs/master/api/classes/Scale.html#getlabelitems

@cmcnulty cmcnulty closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant