-
Notifications
You must be signed in to change notification settings - Fork 244
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
feat: add Fill Threshold feature - making graph filling height customizable #1205
base: dev
Are you sure you want to change the base?
Conversation
Thanks, @Haluska77! This looks like a useful feature. I somehow cannot really imagine, how it works. I'm looking at your screenshot and something doesn't fall in place in my head. (Although the change looks very simple.) Could you provide an example configuration, please? |
hi, glad to hear you like it. This particular picture above is based on following configuration:
|
Interesting. Will test. |
A quick question. |
'fill_threshold' is the value, it might not be only 0, but could be setup on your own. |
We need to add an X-axis line ASAP for this... |
Could it be done by card-mod-styling the line of the fill? I think, it would create a horizontal line. |
Could be, but failed to get a result in Safari.
Outline can be used for svg, not a border. But borders can be set separately (only bottom, for example), outlines cannot be. Of course placing a "zero sensor" is the simplest way for a user. |
Yes, I was thinking too simply. The fill is not just a fill. It's a filled (white) mask, which is then applied to the gradient rect following it. So, adding a stroke to the mask simply increases the size of the fill. 🤷 Thinking aloud: If we are thinking about adding a zero line, we should probably move the logic of "where is the zero threshold" outside of the |
I wonder if it is possible to add a zero line "simply" as an svg element like we added (incompletely) grid lines? |
No, it's good. And I don't think it's off topic per se. But I agree, let's consider it off topic and not add the line in this PR. But maybe as part of the grid-line PR. 👍 |
I would disagree. Vertical grid lines depend on an time span, fixed horizontal lines' position depend on bounds (which could be dynamic). So let's propose this functionality in a separate PR. |
This change makes graph filling height customizable.
Currently, each line (sensor) fills whole height of the graph from its value to the bottom of the graph like on the picture
Blue line represents negative values, purple color represents positive values. Picture graph shows solar production (yellow) and grid power (blue = from grid, purple = to grid).
The amount of consumed energy from grid (blue) is not correctly displayed as it should be filled from zero to its value.
It should look like this:
This change will fix it. It adds a new config variable 'fill_threshold' which represents user expected value that graph is going to be filled up. 'fill_threshold' is optional. If 'fill_threshold' contains string, empty string or any non number value, then it is ignored.