Anyone know how to get x-axis labels to be vertical with google charts API?
I need to fit a lot of labels in a small chart.
Thanks
Anyone know how to get x-axis labels to be vertical with google charts API?
I need to fit a lot of labels in a small chart.
Thanks
It is possible now
The trick is in the chartArea.height = 300 and chartArea.top = 100, height:600
Yes!
Set hAxis.slantedText to true and then set hAxis.slantedTextAngle=90. Like so...
this is a bit of an old thread. but i was searching for this myself and came across this...
https://developers.google.com/chart/interactive/docs/gallery/areachart#Configuration_Options
Look for: hAxis.slantedTextAngle and hAxis.slantedText. Set your angle to 90 for vertical display (or anything in between for a slant).
Another possible way you can "work around" this issue is to add an x axis:
could change to:
(Make sure anything you did to your original x axis has the same applied) then set your labels every other in one axis and every other offset by one in the other x axis (or every third depending on how long your labels are).
Note the two || for an empty label between. That way on your graph the labels switch off axises and you have a little more space:
Diagonal Text here. This is my way of doing it, I hope it will help them.
https://jsfiddle.net/8tvm9qk5/
The code:
and