-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detail view for energy devices graph #19068
Conversation
I think that a consistent look of the disabled option would look better. Now we use strikethrough (for example in history), so the clickable filters in the summary view should have the same look. WDYT? |
I would have also liked strikethrough but it's not an option provided by chart.js. The label strings are rendered on their canvas by their internal code, it's not something that we can style with CSS. It may be technically possible but I think it would involve having to compute the X,Y coordinates of the start and end of each label and draw the strikethrough line manually with chart.js line drawing commands. But the PR was getting a bit long already and decided to punt that to maybe investigate another day. |
I looked at chart.js (4.4.1) samples and all of them have strikethrough when you disable an item in the legend - https://www.chartjs.org/docs/latest/samples/bar/horizontal.html |
Yes that is the legend, but what we are discussing is not the legend but the axis tick labels. The horizontal bar chart does not have a legend. |
D'oh. |
@Madelena had some ideas for this, and will come back to you Can we split this PR in 2 PR's, one for being able to hide items in the current graph, and 1 for adding the detail view? |
Maybe can be split, I remember a good amount of the refactoring here was related to keeping the visibility lists synchronized correctly between the two charts (so a dataset hidden in one chart was still hidden when you flipped the mode), not sure how simple that would all be to tease apart again. I'll look if I find time, otherwise maybe wait to hear the other feedback. |
Ok I guess that was not too bad. I think I satisfied the request, just removed visibility toggles from horizontal bar chart, and forced all datasets always visible. The detail view still has clickable visibility toggle, but that is handled just like how it is handled in all other bar charts, but it doesn't carryover to the horizontal chart. |
Hi 👋 Thank you for the awesome feature 🤩 I discussed the PR with the product and design team and we ended with a proposal :
WDYT? |
I don't necessarily feel like I would want to remove the legend, as it is what allows for temporary hiding of datasets, which I feel like is a very useful feature? Is it strongly desired for that not to be interactive? Otherwise it is very difficult if you want to focus on say behavior of a particular device, which might be too hard to view under the noise of everything else. |
Ok let's keep the legend for now 🙂 |
Ok, I'll try pulling this out into an entirely new card and add it to the overall energy strategy. |
… energy-devices-detail
… energy-devices-detail
Yeah I think so. Any suggestion? Couldn't decide if I should rename one or both. |
My proposal : |
This changes can support separated graphs for high power and low power devices ? When looking both in same graph is very difficult to see values for the devices that use very low power compared with devices that use a lot like car, heating, pumps etc. |
Hmm, can't say I'm a fan of that, given that "energy usage" seems like it could apply equally to both graphs, it doesn't really touch on what is the differentiation. Maybe |
There's only one detailed graph, but if desired you can click the legend to filter out the high power devices, and the graph will rescale to zoom into the lower power devices remaining. |
I like your proposal @karwosts! May be we can replace summary by total as it's the total during the period? |
That'd be fine. If you want an adjustment feel free to mark a suggested change for any of the lines in en.json and I'll accept it. |
Co-authored-by: Paul Bottein <[email protected]>
Proposed change
New feature for the energy devices graph:
toggle to flip between summary view (current) and detail view (hourly/daily similar to other graphs).clickable filtering in the summary view.Type of change
Additional information
https://community.home-assistant.io/t/wth-why-cant-i-view-energy-usage-for-individual-devices-in-a-similar-graph-as-the-energy-source/468042
Checklist
If user exposed functionality or configuration variables are added/changed: