Open edwardhorsford opened 5 months ago
is there any update for this?
is there any update for this?
My hacky solution was to just use stacked column with narrow bars. But not so narrow that it slows the UI down. I suspect the bug is probably with the apex library that this card uses.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
Not stale. I can confirm using type: column
"fixes" the issue.
I wonder if this could be related to inconsistent timestamps for the X axis (every series having slight different timestamps which overlap visually but not code-wise).
This could also explain why the tooltip doesn't show multiple datapoints at once.
Checklist
Describe the bug When charting 3 series with stacked line or area, the result is incorrect. Stacked columns render correctly. My hunch is that this is related to one series being at 0 for considerable periods and the summing calculation using the previous positive value when this happens.
I have three series - each an energy monitoring plug where the series is watts over time. I'm attempting to plot an area graph with all three stacked.
Unstacked area (correct):![Screenshot 2024-02-18 at 15 42 49](https://github.com/RomRider/apexcharts-card/assets/2204224/1f6a585f-ab67-4912-9d06-58b4878f26a9)
Stacked column (correct):![Screenshot 2024-02-18 at 15 43 32](https://github.com/RomRider/apexcharts-card/assets/2204224/b7f0d2f4-e1cb-49e4-902c-a1958305aa8f)
Stacked area (incorrect):![Screenshot 2024-02-18 at 15 43 04](https://github.com/RomRider/apexcharts-card/assets/2204224/bc187f4f-f85c-43fe-88b7-5cab16d9513e)
In the stacked area the blue series (UPS) is shown a hump in wattage that does not exist with usage at ~150w, then reducing to half after a while - this does not exist in the data.
Video showing a the step goes away when the fridge series is removed, even though there's no usage during that time:![disable-fridge](https://github.com/RomRider/apexcharts-card/assets/2204224/81d338c6-bae8-46f3-aff1-6857acb26e67)
Here is the blue series on its own:![Screenshot 2024-02-18 at 15 43 18](https://github.com/RomRider/apexcharts-card/assets/2204224/fef94e71-5825-4a86-8fc6-e72e128e4a17)
Thoughts
I suspect this may be related to the fridge reading 0 for extended periods. I've tried using
fill_raw
with bothzero
andlast
to no effect.My hunch is that the stacking algorithm is using last available value for a series when the current value is zero - here incorrectly adding the last value of the fridge to the totals, even though it's at 0.
I've tried also using a transform to make sure the value is always at least 1w but it did not work.
Version of the card Version: 2.04
To Reproduce This is the configuration I used:
Screenshots If applicable, add screenshots to help explain your problem.
Expected behavior The stacked area should closely resemble the stacked column.
Desktop (please complete the following information):