RomRider / apexcharts-card

📈 A Lovelace card to display advanced graphs and charts based on ApexChartsJS for Home Assistant
MIT License
1.15k stars 78 forks source link

Graph_span dynamic or template-able? #735

Open Hellis81 opened 2 months ago

Hellis81 commented 2 months ago

Checklist

Is your feature request related to a problem? Please describe. I want there to be an auto option for graph span or being able to template the span. Example:

graph_span: "{{ '48h' if state_attr('sensor.nordpool_kwh_se4_sek_3_10_025', 'tomorrow') != [] else '24h' }}"

So if tomorrows values are in the sensor, include them in the graph, else fill the graph with todays values.

Describe the solution you'd like It would be nice if it could include templates, or if the graph could scale to the data size.

Describe alternatives you've considered I guess I could create two cards and use the conditional card to hide one of them depending on if the sensor includes tomorrow or not.

Additional context image image

mattmeiser commented 1 month ago

I would love to see this feature as well. Use case is to display a graph of temps from my Fireboard BBQ controller. Span would be dynamic, calculated as from the time I last powered on my pellet grill's smart outlet.

doppynl commented 3 weeks ago

Would love to have this as well. Mainly to be able to switch between climate conditions between 2hr,6hr,24hr,7days. I could make multiple graphs and show them conditionally, but that is a lot more cumbersome.

Toretto5060 commented 2 weeks ago

What I need is the span from the 1st of each month to the current date, and this is feasible for me to do. WX20240829-213509@2x WX20240829-213523@2x

Hellis81 commented 2 weeks ago

What I need is the span from the 1st of each month to the current date, and this is feasible for me to do. WX20240829-213509@2x WX20240829-213523@2x

You wouldn't need the sensor if templates was possible 😜