google visualization line chart remove horizontal grid lines
Asked Answered
B

4

29

How do I remove the horizontal grid lines in a Google visualization line chart? I have already tried setting

minorGridlines: {count: 0 }, gridlines: {count: 0 } 

on both hAxis and vAxis.

Here is a jsfiddle of my chart.

http://jsfiddle.net/martlark/2XBhc/

enter image description here

Bulganin answered 4/8, 2013 at 4:14 Comment(2)
what you have tried ?Chuckhole
Added sensible edit to better explain my tries.Bulganin
I
91

Set the vAxis.gridlines.color option to "transparent" to make them disappear:

vAxis: {
    gridlines: {
        color: 'transparent'
    }
}

This doesn't work for the charts when displayed in IE < 9 (as those versions use VML instead of SVG, and the chart's don't support transparency in VML). In this case, you will need to set the gridline color to match the background color of the chart.

Inclination answered 4/8, 2013 at 5:34 Comment(3)
Still got the middle line!Bulganin
On your "fake" y axis, you need to set the "baselineColor" option to transparent as well. Also, you shouldn't use the vAxis option when using the vAxes option, as the behavior of the interaction between the two is unknown - just set the gridline color in each vAxes axis suboption and you'll be fine. See both here: jsfiddle.net/asgallant/2XBhc/4.Inclination
And of course of horizontal lines, it would be hAxisAlvarado
V
14

Set gridlines color to none

 gridlines: {
                color: 'none'
            }

This will also work

Verger answered 1/7, 2015 at 5:58 Comment(0)
K
1

Tested & Working...

options = {
  vAxis: {
    gridlines: {
      interval: 0
    }      
  }
}
Kennet answered 1/9, 2021 at 19:45 Comment(0)
P
0

gridlines.count:0 is mentioned in the docs

You can specify a value of 1 to only draw one gridline, or 0 to draw no gridlines.

Pasho answered 3/3, 2023 at 21:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.