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

axis labelAlign manually set to left overlaps chart by default (without layerPadding) #3808

Open
declann opened this issue Oct 3, 2023 · 0 comments
Labels
bug For bugs or other software errors

Comments

@declann
Copy link

declann commented Oct 3, 2023

Hi guys!

Currently planning to simulate indented tree-type axes labels by using emojis and some logic in my data processing :)
separate issue Re indented trees: #3382

For this workaround I need to left-align my y axis labels and transform the field to include correct spacers/emojis.

Here is a 'working' (slightly over-complicated layered) example from vega-lite:

https://vega.github.io/editor/#/gist/838b2b13abe1d3bb96f14afcc34869d4/spec.json

visualization (41)

Here is the relevant y-encoding axis spec:

      "axis": {"ticks": false, "labelAlign": "left", "labelPadding": 150}

It works fine, but I found that I must specify labelPadding here, or else the labels overlap with the chart:

visualization (40)

Here is a slightly simplified spec compiled to vega:

https://vega.github.io/editor/#/gist/94b8b93e347448381e07861e300e9a29/spec.json

among the final lines under axes it has:

      "labelAlign": "left",

By changing to right, the chart is OK and padding doesn't need to be specified.

However, my desired indenting effect depends on left-align. I can specify padding (as above), but for generating these charts it's a little problematic.

Is it feasible for vega to calculate the padding for left-align as it does for right-align, whenever no padding is specified?

Note: similar issue when I try "labelAlign": "center"

Related: #1751

Thanks,
Declan

@declann declann added the bug For bugs or other software errors label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For bugs or other software errors
Projects
None yet
Development

No branches or pull requests

1 participant