Hi guys, I’ve been using bar charts for a while in Studio and I notice how the xAxis sometimes hides some labels. Is there a way to show all the labels in the xAxis?
Bar chart labels hidden in xAxis
arturo
#2
Hi @Paul, can you please share a screenshot to better understand what you’d like to accomplish.
Paul
#3
Sure, as you can see in the picture below, the bar chart has 10 bars but it only shows 5 labels in its xAxis. I wonder if there is a way to show all labels corresponding to each bar.
arturo
#5
Hi @Paul, got it. One way to do it is to use horizontal bars instead of vertical ones. There you can also render the labels inside the bars or outside.
Another way if you want to use vertical bars is to rotate the labels instead. You can use the rotate option available in the Axis definition as shown below:
.set("xAxis", { rotate: -90, labelGap: 80 })
When using the above configuration, the label rotates minus 90 degrees as shown in the picture below: