prohand
September 4, 2026, 11:16am
1
Hello,
I noticed an issue with the display of the socket power .
As visible in the attached screenshots, the graph and consumption values evolve, sometimes significantly, but the displayed variation remains systematically stuck at +47.50 % .
For example, according to the screenshots, the consumption profile is very different, while the variation indicator never changes.
Expected behavior: the percentage variation should be recalculated and updated based on the displayed data.
Observed behavior: the value remains at +47.50 % , regardless of the graph’s evolution.
Example with the fridge socket alone indicating 95% but still 47.50% above:
Thank you
Hi everyone!
This topic is now in development .
A PR has been opened to make the graph widget header follow the series visible in the legend:
master ← claude/bug-affichage-variation-nbk3fh
ouvert 11:28AM - 04 Sep 26 UTC
### Description
On a chart box with several devices and "display variation" ena… bled, the value and the variation shown above the chart were computed on **all** the devices of the box. Hiding a device through the chart legend changed the curves but never the numbers.
That is what the forum user saw on their "Puissance prises" box (washing machine + fridge): the header always showed `43.13 W +47.50%`, i.e. the average of the last values `(0 + 86.25) / 2` and the average of the per-device variations `(0% + 95%) / 2`, whatever was toggled in the legend.
What changes:
- **The header follows the legend.** `ApexChartComponent` now forwards the ApexCharts `legendClick` event to `Chart`, which keeps the list of hidden series and recomputes the last value and the variation from the visible series only. Hiding the washing machine shows the fridge alone (`86.25 W +95%`), showing it again goes back to the average of both.
- **Hidden series stay hidden while browsing periods.** ApexCharts keeps collapsed series when only the data is refreshed (`updateOptions`), so the hidden list is kept across data refreshes too, and it is reset when the chart instance is recreated (a new chart shows all its series). Hiding every series empties the header instead of showing stale numbers.
- **The variation is the variation of the averaged value**, not the average of the per-device variations, so the two numbers of the header describe the same quantity ("the average of the visible devices is now X, Y% more than at the start of the period"). It also avoids a device starting the period at `0` turning the whole variation into `Infinity`. In the case above the box now shows `43.13 W +95%` with both devices visible.
- The first/last values are now converted (miles/°F preferences) on the aggregated value (`min`/`max`/`sum`…) rather than only on `value`, which was a small pre-existing inconsistency.
Verified in demo mode (`npm run start-demo`, with `display_axes` temporarily enabled on the "Production and consumption" box) using Playwright: hide series A → header shows series B only, show A again → back to the average, hide B → series A only, previous period → B stays hidden in the chart and the header shows A only, hide both → empty header.
| both visible | solar inverter hidden | previous period, electric meter hidden |
|---|---|---|
| `2027 W -28%` | `1414 W -27%` | `3656 W +35%` |
## Forum
Forum: https://community.gladysassistant.com/t/bug-d-affichage-la-variation-en-ne-se-met-pas-a-jour/10797
### Checklist
- [x] Tests pass: front-only change, no server code touched; Cypress has no chart-box spec, the behaviour was verified manually in demo mode with Playwright (see above)
- [x] Linter and prettier pass on both front and server (`npm run eslint`, `npm run prettier`)
- [x] No undocumented breaking change
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01HrXCc7YmGQP6o97Evz8ttc
---
_Generated by [Claude Code](https://claude.ai/code/session_01HrXCc7YmGQP6o97Evz8ttc)_
## Summary by CodeRabbit
- **Enhancements**
- Chart summary values now recalculate based on the series currently visible in the legend.
- Last values and variations are calculated from summarized data across visible series for more accurate chart headers.
- Chart summaries reset appropriately when the chart is recreated or refreshed.
- Legend interactions now update the displayed chart summary automatically.
Feel free to follow the PR, test (optional, especially for small requests) and give your feedback here if needed.