You cannot set the gridlines at an explicit value. You can set the h/vAxis.minValue/maxValue options, which the API will use as guidelines to draw the chart; or you can set the h/vAxis.ViewWindow.min/max options, which will set explicit boundaries on the chart. Either way, the API only draws gridlines on what it considers to be "nice" values (in the first case, it sets the actual min/max of the chart to coincide with gridlines, in the second, the min/max might not coincide with gridlines). There is no way to guarantee that gridlines will appear on specific values.
That said, there is a cheat around this that works if you want vertical gridlines on specific values (does not work for horizontal gridlines). Turn the hAxis gridlines off by setting hAxis.gridlines.color = 'transparent', then add in domain axis annotations on the values where you want gridlines. It would look something like this:
http://jsfiddle.net/asgallant/dxJUY/ On Saturday, September 15, 2012 3:28:34 AM UTC-4, Marquis wrote:
Hi,
I have been looked through many thread, but I still don't have an answer.
Now, I wish to set the Grid Lines of a Line Chart or a Scatter Chart to a particular value (like top line is 100.3, mid line is 98.77, bottom line is 87.2). Is there a way to do that? or the value has to be auto-generated?
Thx