Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
420 views
in Technique[技术] by (71.8m points)

javascript - google visualization line chart remove horizontal grid lines

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...