Limiting the number of x-axis labels for line chart

1,071 views
Skip to first unread message

corinne zaoui

unread,
May 21, 2013, 5:27:20 AM5/21/13
to google-visua...@googlegroups.com
Hi,

My code is

hAxis: {
viewWindow:{min:'2013-04-16',max:'2013-05-15'},
    textStyle: {fontName: 'Arial', fontSize: '12', color:'666666' },
gridlines:{count: 10},textPosition: '90',
},
I want to limit the number of x-axis label but this do nothing (i have all dates)

How i can do ?

Other question : how I can turn the label?

Thanks

asgallant

unread,
May 21, 2013, 9:41:44 AM5/21/13
to google-visua...@googlegroups.com
The gridlines.count option is broken for date axes; there is currently no way to set the number of labels on a date axis.  The dev team is aware of the problem and is working on a fix, last I heard.  Rotating labels is not supported for continuous axes.

You may be able to achieve what you want by switching to a discrete axis (use a DataView to return a string value for your dates); this gives you access to the discrete axis options which will give you some control over the number of labels and allows you to rotate them.  In making the switch, though, you lose the benefits of continuous axes, so if your data isn't evenly spaced (eg, 1 data point every day, as an example), switching will make the chart look wrong.
Reply all
Reply to author
Forward
0 new messages