Charts 谷歌嵌入api设置图表背景色
我正在尝试编辑我的图表的背景色,但是它不起作用。我只能编辑整个图表的背景色,不能编辑图表区域,我的代码如下Charts 谷歌嵌入api设置图表背景色,charts,google-api,google-visualization,Charts,Google Api,Google Visualization,我正在尝试编辑我的图表的背景色,但是它不起作用。我只能编辑整个图表的背景色,不能编辑图表区域,我的代码如下 var sessions = { query: { dimensions: 'ga:date', metrics: 'ga:sessions' }, chart: { type: 'LINE', options: {
var sessions = {
query: {
dimensions: 'ga:date',
metrics: 'ga:sessions'
},
chart: {
type: 'LINE',
options: {
width: '100%',
title: 'Sessions',
titleTextStyle: {
color: '#0f55c4',
fontSize: '16',
bold: true
}
}
}
};
我尝试过以下所有组合,但没有一个有效
backgroundColor: 'red', (changed background colour not chart colour)
chartArea: {
backgroundColor:'red'
} (again background colour only)
chartArea: {
backgroundColor: {
fill: 'red'
}
} (again background colour only)
chartArea: {
fill: 'red'
} (doesn't work)
不确定我还能尝试什么我已经尝试了我在文档和几个网站上能找到的所有东西。它只是进入整个背景,不仅仅是图表区域,非常感谢任何帮助
谢谢。根据,您可以更改图表区域的背景色和背景色
我可以使用以下选项更改这两种颜色:
var options = {
backgroundColor: '#ccc',
chartArea: {
backgroundColor:'#e5e5e5'
}
};
遗憾的是,我不熟悉你安排选项的方式,但我猜你应该把这个选项放在
options: {
width: '100%',
.....
chartArea: {
backgroundColor:'#e5e5e5'
}
.......
};
我希望这对你有帮助 嘿,是的,这也适用于我,但是如果你看这张图片:我希望蓝色部分基本上是一种不同的颜色,但我无法在任何地方找到它,起初我认为蓝色部分是图表区域(知道现在不是这样)。谢谢你的帮助。