I made below apex chart to view power consumption in my house. A question that I have is if it is possible to create a switch that removes certain graphlines on the graph add adds them accordingly. For example, in this chart I pushed in the legend on two sensors so that the lines disappear, I want to create a switch to do it
Not using apexcharts myself.
If the card has an option like โshow_graphโ (true/false) per entity & this option does not support jinja/JS templates, a possible workaround could be a wrapping the apexcharts into a custom:config-template-card like
type: custom:config-template-card
entities:
- sensor.xxx # these 2 sensors are shown in apexcharts
- sensor.yyy
- switch.show_sensor_yyy #switch or input_boolean to control
card:
type: custom:...apexcharts...
...
show_graph: >-
${states['switch.show_sensor_yyy'].state === 'on' ? 'true' : 'false'}