Skip to content

Automatic sizing when nominal axis labels have angle 0? #8412

Answered by jwoLondon
the21st asked this question in Q&A
Discussion options

You must be logged in to vote

Try setting "width":"container".

But I'd argue it is not often (if ever?) desirable to resize by label width. Do you really want your bar width to be determined by the label that takes up the most space in your categorical variable? I'd suggest that the negative visual impact of bars that are too 'fat' might outweigh the benefits of full text for every label.

Here are some other possible strategies:

  • Setting labelOverlap to true will prevent the text from overplotting as in your example by labelling only those bars that don't result in overlapping text. For many nominal data this may not be desirable if the missing labels cannot be easily guessed.
  • Reversing the x and y encoding so the lon…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by domoritz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants