Skip to content

bug fix: label rotation not working at +90 and -90 deg. #172

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

praveenvitara
Copy link
Contributor

textPxLength is taken based on label orientation, fixes issues with autoRotation and rotation at 90 and -90 deg.

while rendering axis, labels are initially created horizontally and moved and rotated at the later stages in which autoRotation and rotation for 90 deg is failing to apply due to invalid textPxLength, which is previously taken from label width.

@pawelfus
Copy link
Collaborator

pawelfus commented Dec 2, 2020

Hi @praveenvitara

Thank you for the PR! Could you create a demo that shows what is broken? Exactly the same code is used in the core for labels.

I'm afraid the solution you implemented won't work in many other scenarios, for example 45deg, 30deg, 15deg etc.

I think we should use real width, not the text length (as variable name suggests), because it's used to calculate required space for Axis to fit in all category names (or alternatively apply ellipsis or word wrapping).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants