hajo62
(Hajo)
December 6, 2021, 11:15am
1
I wonder if there is a way to configure the transparency of a graph area - especially for the Apexcharts-Card? Some themes make the whole widget transparent, but I haven’t seen a way to configure this only for the graph area itself.
Why: I the whole widget is transparent, the background colors aren’t shown very well.
tom_l
December 6, 2021, 12:06pm
2
Set opacity:
to less than 1 for the apexchart element you are using.
hajo62
(Hajo)
December 6, 2021, 1:37pm
3
But which element am I using?
Haven’t seen an explicit graph area element; where would I put that opacity: 0.9
tom_l
December 6, 2021, 1:45pm
4
I have no idea, you haven’t shared your card config.
hajo62
(Hajo)
December 6, 2021, 1:53pm
5
Thought it would be a generic answer…
type: custom:apexcharts-card
graph_span: 28d
span:
end: day
header:
show: true
title: 7-Tage Hospitalisierung [28d]
show_states: false
apex_config:
annotations:
yaxis:
- 'y': 0
y2: 3
fillColor: green
- 'y': 3
y2: 6
fillColor: yellow
- 'y': 6
y2: 9
fillColor: red
- 'y': 9
y2: 99
fillColor: violet
series:
- entity: sensor.rki_covid_germany_hospitalization
color: red
name: Deutschland
- entity: sensor.rki_covid_nrw_hospitalization
color: lightblue
name: NRW
all_series_config:
extend_to_end: false
curve: stepline
group_by:
func: last
duration: 1d
tom_l
December 6, 2021, 2:02pm
6
Lucky for you annotations support opacity https://apexcharts.com/docs/options/annotations/
apex_config:
annotations:
yaxis:
- 'y': 0
y2: 3
fillColor: green
opacity: 0.9
- 'y': 3
y2: 6
fillColor: yellow
opacity: 0.9
- 'y': 6
y2: 9
fillColor: red
opacity: 0.9
- 'y': 9
y2: 99
fillColor: violet
opacity: 0.9
1 Like