Rah*_* PK 3 canvas google-visualization
我需要在指定区域的Google折线图中水平填充背景色。我看了所有的api,但没有找到解决方案。Google图片图表(我认为它已被弃用)具有某些属性,但是我正在使用交互式图表。我只是附上我真正想要的图像。
请帮忙。

您可以通过使用ComboChart而不是LineChart并添加一些额外的数据系列来做到这一点。在您的示例中,您将有3个额外的系列,每行分别具有800、1000和1200的值。然后,设置“系列”选项,以使这些“区域”系列不在图例中显示,并且当您将鼠标悬停在其上时也不会生成工具提示:
series: {
0: {
type: 'line'
},
1: {
type: 'line'
},
2: {
lineWidth: 0,
type: 'area',
visibleInLegend: false,
enableInteractivity: false
},
3: {
lineWidth: 0,
type: 'area',
visibleInLegend: false,
enableInteractivity: false
},
4: {
lineWidth: 0,
type: 'area',
visibleInLegend: false,
enableInteractivity: false
}
}
Run Code Online (Sandbox Code Playgroud)
在此处查看示例:http : //jsfiddle.net/asgallant/apH2B/