Google area chart variable opacity under line?

青春壹個敷衍的年華 提交于 2019-12-24 00:38:24

问题


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:


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
    }
}


来源:https://stackoverflow.com/questions/22761836/google-area-chart-variable-opacity-under-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!