-
I built a simple bar chart with a nominal X axis type but I want to have the labels (country names) non-rotated for good readability. When I specify that, there's overlap between the labels. Is there any way for vega lite to automatically make the chart wider to accommodate for the axis labels? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Try setting 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:
|
Beta Was this translation helpful? Give feedback.
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:
labelOverlap
totrue
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.