谷歌可视化折线图删除水平网格线

问题描述 投票:0回答:4

如何删除 Google 可视化折线图中的水平网格线?我已经尝试设置

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

在 hAxis 和 vAxis 上。

这是我的图表的一个 jsfiddle。

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

enter image description here

javascript google-visualization
4个回答
90
投票

vAxis.gridlines.color
选项设置为“透明”以使其消失:

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

在 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.


13
投票

将网格线颜色设置为无

 gridlines: {
                color: 'none'
            }

这也行


1
投票

测试和工作...

options = {
  vAxis: {
    gridlines: {
      interval: 0
    }      
  }
}

0
投票

gridlines.count:0
docs

中提到

您可以指定值 1 只绘制一条网格线,或指定 0 不绘制网格线。

© www.soinside.com 2019 - 2024. All rights reserved.