Google area chart variable opacity under line?

2019-07-20 01:27发布

I am using area charts from google charts and I wondered if there is a way to set the opacity for each line ?

See this example :

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

If I use areaOpacity: 0.0 in the parameter array , it will hide all color underneath the lines, but I want the opacity of the red line (sales) to be 0.0 (which should hide it). The other line should be 1.0, is there any way to get it that done?

I've been searching for this a while now and I get the feeling that I'm looking for the wrong keywords. Any help is appreciated !

1条回答
混吃等死
2楼-- · 2019-07-20 01:50

You can set area opacity by data series via the series.<series index>.areaOpacity option:

series: {
    0: {
        // set the area opacity of the first data series to 0
        areaOpacity: 0
    }
}
查看更多
登录 后发表回答