Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google area chart variable opacity under line?

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 !

like image 477
developers-have-no-vacation Avatar asked Dec 14 '25 01:12

developers-have-no-vacation


1 Answers

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
    }
}
like image 123
asgallant Avatar answered Dec 16 '25 21:12

asgallant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!