Google Chart设置网格线颜色

Luk*_*uke 9 javascript syntax google-visualization gridlines

我正在尝试使用Google Charts在我的图表背景中设置网格线的颜色.

我有这个代码来设置图表的选项:

ac.draw(activityData, {
    title : 'Monthly Coffee Production by Country',
    isStacked: true,
    width: 600,
    height: 400,
    fontSize: 0,
    backgroundColor: '#1E4D6B',
        hAxis.gridlines.color: '#1E4D6B'
});
Run Code Online (Sandbox Code Playgroud)

但是,我不知道如何使用配置选项页面hAxis.gridlines.color中出现的代码中的选项.

如果我简单地说hAxis.gridlines.color,它在控制台中出现错误:

未捕获的SyntaxError:意外的令牌.

使用包含句点的选项的正确语法是什么?

Rom*_*eri 10

这是一个对象litteral你传递作为draw()的第二个参数,所以我想它应该是:

hAxis: {gridlines: {color: '#1E4D6B'}}


ale*_*yci 6

gridlineColor: '#f0f'也有效,这就是你要做的。

{vAxis: {gridlineColor: '#f0f'}}
Run Code Online (Sandbox Code Playgroud)