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

fix(axis): center axis labels #2854

Merged
merged 1 commit into from
Oct 25, 2023
Merged

fix(axis): center axis labels #2854

merged 1 commit into from
Oct 25, 2023

Conversation

marcelgerber
Copy link
Member

@marcelgerber marcelgerber commented Oct 25, 2023

Fixes #2850.

The issue here is that bounds are the bounds of the whole charting area, but the vertical axis has some extra bottom padding and the horizontal axis has some extra left padding:

V         |
e         |
r         |
t         |
i         |
c         |
a         |
l         |
          |
a         |
x         |
i         |
s         |
          |
-------------------------------------------------------------
PADDING   |                   Horizontal axis

By relying on axis.range, and in particular on the new axis.rangeCenter property, we can circumvent this issue.

Copy link
Member

@sophiamersmann sophiamersmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for fixing this so quickly! It's one of these things that once you see them, you can never unsee them...

@marcelgerber marcelgerber merged commit feda7b1 into master Oct 25, 2023
18 of 20 checks passed
@marcelgerber marcelgerber deleted the axis-label-centered branch October 25, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scatter plot: y-axis label is not perfectly centered
2 participants