Google Chart Background Color

2019-01-18 08:47发布

I'm styling a google chart using the javascript api. I want to change the background of the area where the data is plotted. For some reason when I set background options like so:

chart.draw(data, { backgroundColor: { fill: "#F4F4F4" } })

It changes the the background of the whole chart and not the area where the data is plotted. Any ideas on how to only change the background of the plotted area? Thanks

7条回答
你好瞎i
2楼-- · 2019-01-18 09:37

You can do it just with CSS:

#salesChart svg > rect {  /*#salesChart is ID of your google chart*/
    fill: #F4F4F4;
}
查看更多
登录 后发表回答