谷歌面积图线下可变不透明度?

dev*_*ion 3 google-visualization

我正在使用谷歌图表中的面积图,我想知道是否有办法设置每条线的不透明度?

看这个例子:

https://developers.google.com/chart/interactive/docs/gallery/areachart?hl=nl#SimpleExample

如果我在参数 array 中使用areaOpacity: 0.0,它将隐藏线条下方的所有颜色,但我希望红线(销售额)的不透明度为 0.0(应该隐藏它)。另一行应该是1.0,有什么办法可以完成它吗?

我已经搜索这个有一段时间了,我感觉我正在寻找错误的关键字。任何帮助表示赞赏!

asg*_*ant 6

您可以通过以下选项按数据系列设置区域不透明度series.<series index>.areaOpacity

series: {
    0: {
        // set the area opacity of the first data series to 0
        areaOpacity: 0
    }
}
Run Code Online (Sandbox Code Playgroud)