google visualization line chart remove horizontal

2020-03-08 09:11发布

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

2条回答
狗以群分
2楼-- · 2020-03-08 09:33

Set gridlines color to none

 gridlines: {
                color: 'none'
            }

This will also work

查看更多
家丑人穷心不美
3楼-- · 2020-03-08 09:43

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.

查看更多
登录 后发表回答