Adjusting the x-axis intervals between labels (i have weekly data going back 3 years but when i graph it only gives me quarterly x-axis labels)

628 views
Skip to first unread message

rcom...@dyn.com

unread,
Mar 13, 2013, 7:56:20 PM3/13/13
to google-visua...@googlegroups.com
Hi all,
So I'm just using a line chart and graphing a few weekly metrics over a 3 year time frame.  However when I go to chart the data, the chart only shows the dates quarterly across the bottom of the chart.  All the data points for each week are there on the line chart, but the x-axis labels only show quarterly dates.  Is there a way that I can adjust how many data labels i can show on the x-axis as labels?  Or does google charts have a max number of data labels that can be shown on the x-axis of a chart and if you go above that it'll consolidate it?

I'm under the gun to find an answer to this.  Thank you for any help you can offer, I really appreciate it.
~Ryan

asgallant

unread,
Mar 13, 2013, 11:43:24 PM3/13/13
to google-visua...@googlegroups.com
I assume you have a "date" type axis (and not a "string" type with string representations of dates).  If so, then the API auto-calculates what values to use for the axis based on the total span of time displayed.  Normally, you would be able to use the hAxis.gridlines.count option to control the number of axis values displayed (as each gridline gets an axis value), but that option is broken for "date" type axes right now.  The dev team indicated that it is working on a fix, which ideally will be out in the next month or two if all goes well.  Until it gets fixed, though, the only option is to convert to a string type axis and use the hAxis.maxAlternation/maxTextLines/minTextSpacing/showTextEvery options to see if you can get the labels to display the way you want (this can be a tedious process and there is no guarantee that it will get you the results you want; plus, if your data has any gaps in it [eg, you skip dates occasionally], the spacing in the chart will be wrong).
Reply all
Reply to author
Forward
0 new messages