Forcing hAxis labels and grid lines for the first and last data points on a line chart

163 views
Skip to first unread message

marcus-pdx

unread,
May 24, 2012, 7:38:22 AM5/24/12
to google-visua...@googlegroups.com
Hello! I am using a line chart with an hAxis of type date - so continuous. I want the first and last data points to be on grid lines and have hAxis labels. I have tried various combinations of viewWindowMode - maximized and explicit, minValue and maxValue, viewWindow.max and .min but no results.  I found the post for the undocumented showTextEveryMode option  - Does this work on continuous data? And I need labels on the first and last point.  What's the right way to do this?  Thanks for any guidance.

asgallant

unread,
May 24, 2012, 11:20:53 AM5/24/12
to google-visua...@googlegroups.com
The charts always render with 5 evenly-spaced gridlines when using a continuous axis, and each gridline gets a label.  Setting the viewWindowMode to 'maximized' will render the first and last points on the edges of the chart area, but there is no guarantee that they will have labels.  The only way to achieve what you want (while using a continuous axis) would be to deliberately restrict your data sets to those which produce labels where you want them.

If your data is evenly spaced (ie, 1 data point per day, 1 per hour, something like that), then you can switch to a discrete axis, which would get you your labels, but you would lose the gridlines.
Reply all
Reply to author
Forward
0 new messages