4
votes

I'm using a simple Line Chart from Google Charts.

I have two problems:

  • Vertical and horizontal axis have a title. But I can't change their orientation. I want the vertical title written horizontally instead of vertically. vAxis and hAxis don't seem to have orientation options, any tips?

  • The same for horizontal legend. it is written horizontally and transforming en diagonal when there are a lot of info. I want to writes it everytime en diagonal.

So basically the two questions are the same. How to change the text orientation?

Thank!

3

3 Answers

3
votes

There is a workaround for this. Already there is a question regarding this. You take a look at this Vertical labels with google charts API?. Hope this will help you.

8
votes

It is possible now:

var options = { 
    title: "Test", 
    hAxis: { 
        direction: -1, 
        slantedText: true, 
        slantedTextAngle: 90 // here you can even use 180 
    } 
};
1
votes

There's no way, currently, to rotate the vertical axis title, sorry.

As far as transforming the titles in the horizontal axis, you're in an edge case whether your graph is continuous or discrete. If your data is discrete, you can use the slantedText option. So, to summarize, make sure you have discrete data, and set the above option.