Skip to content

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

Open
praveenvitara wants to merge 1 commit intoblacklabel:masterfrom
praveenvitara:master
Open

bug fix: label rotation not working at +90 and -90 deg.#172
praveenvitara wants to merge 1 commit intoblacklabel:masterfrom
praveenvitara:master

Conversation

@praveenvitara
Copy link
Copy Markdown
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
Copy Markdown
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