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

titleAngle:0 can cause extra whitespace #2368

Closed
syntagmatic opened this issue Feb 6, 2020 · 1 comment · Fixed by #2421
Closed

titleAngle:0 can cause extra whitespace #2368

syntagmatic opened this issue Feb 6, 2020 · 1 comment · Fixed by #2421
Labels
enhancement For enhancement of existing features
Milestone

Comments

@syntagmatic
Copy link

syntagmatic commented Feb 6, 2020

Label trouble when moving the axisY label to the top. Here's an example with the flight statistics bar graph.

Everything looks good except for extra whitespace to the left of the chart, which appears to be based on the width of the Y-axis title text as if the textAlign property were set to right. Possibly a bug when using titleAngle?

image

I got close to the layout I wanted with this version, by setting titleX: 0. This removed the extra whitespace, but left-aligns the title to the axis line rather than the left edge of the chart.

image

I couldn't find a combination of textAlign, textAnchor and titleX values that yielded the layout I was looking for when using titleAngle: 0 without creating the empty whitespace in the first image.

@jheer jheer added the enhancement For enhancement of existing features label Feb 27, 2020
@jheer jheer added this to the v5.10 milestone Feb 27, 2020
@jheer
Copy link
Member

jheer commented Feb 27, 2020

Hi! At present, setting both titleX and titleY is the right solution, as this communicates to Vega that it should disable automatic axis title layout and bounds calculation. For now, you will have to include an explicit shift of negative pixels to move the title further left.

The whitespace that arises via other methods is a result of the aforementioned automatic layout. I'm adding this to the queue of things to re-visit in v5.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For enhancement of existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants