-
Notifications
You must be signed in to change notification settings - Fork 464
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
Overlap resolution as function #183
Comments
I agree about adding the possibility to select which labels should be hidden or not, though I'm not sure the plugin needs to provide information about overlapping labels. Currently, label data are part of the private API and I would prefer to avoid exposing it. An alternative solution could be the one explained in this comment. In your example, you would provide a scriptable option for z: ({ dataset, dataIndex }) => dataset.data[dataIndex], |
That seems a reasonable approach. I suspect whatever algorithm someone would use to determine precedence could easily be translated into a z-value. |
I'd like to handle overlap behavior with a function so that if overlap is detected, I can change the label itself. Ex. The data label may be $123,456,789 when not overlapping, but once it detects overlap I can use a function to change the label to $123M. Is it not possible with the library's existing tools? |
Obviously the ideal would be to have the ability to simply not hide any labels by adjusting position on the labels until they don't overlap. However, another solution would be to be able to provide a function which is passed a pair of overlapping labels and decides which one to show and which to hide. For example, I would prefer to hide the one with the smaller value, not the one with the smaller dataIndex.
The text was updated successfully, but these errors were encountered: