RomRider / apexcharts-card

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

For stacked series, adds support for last value in series to be considered as total #711

Closed georgepauna closed 1 week ago

georgepauna commented 1 month ago

In my use case, I have a general power meter, and several individual power meters. I wanted to be able to show all values as stacked, but also have a "unknown power consumption", which needs to be calculated as the difference between the overall consumption and the sum of the other series. I'm very sorry for how the commits look, I am VERY new to git + github, this is actually my first time working with them. If you think this is a useful feature, this is how my graph looks: image

If you like this, please only take the changes in [apexcharts-card.ts], once again sorry for the mess :( The grey series is calculated as I explained above.

RomRider commented 1 week ago

This feature shouldn't be in the card. You can achieve the same using a template sensor within home assistant and then display this sensor in the stack.

georgepauna commented 1 week ago

Indeed, but that means two places to change when adding another sensor. Also it adds data in the recorder. I still think it would be useful :) https://github.com/RomRider/apexcharts-card/issues/550 https://github.com/RomRider/apexcharts-card/issues/673