Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 988
B Seven Avatar asked Dec 09 '11 15:12

B Seven


People also ask

How do you show X axis labels?

On the Layout tab, in the Axes group, click Axes. Click the type of axis that you want to display or hide, and then click the options that you want.

When should you use a column chart?

Column charts are useful for showing data changes over a period of time or for illustrating comparisons among items. In column charts, categories are typically organized along the horizontal axis and values along the vertical axis.


1 Answers

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.

like image 86
B Seven Avatar answered Oct 04 '22 16:10

B Seven