B Seven
B Seven

Reputation: 45943

How to control X Axis labels in Google Visualization API?

There are (too) many labels on the X axis, and they are displayed as '8/...'. They are supposed to be dates (8/22/2011), but since there are too many, they are replaced by ellipsis.

How do you reduce the number of labels so that the dates show up properly?

Upvotes: 13

Views: 13243

Answers (1)

B Seven
B Seven

Reputation: 45943

To show every 4th label: hAxis: {showTextEvery: 4}

To show a total of (about) 4 labels: var showEvery = parseInt(data.getNumberOfRows() / 4);

Thanks to http://groups.google.com/group/google-visualization-api/ for the answer.

Upvotes: 25

Related Questions