Skip to content
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

Feature request: relative color thresholds #182

Open
bokub opened this issue Oct 22, 2019 · 5 comments
Open

Feature request: relative color thresholds #182

bokub opened this issue Oct 22, 2019 · 5 comments
Labels
feature request New feature or request [Status] Maybe Later We'd love to include this at some point, but it's not on our active roadmap (prevents stale marking)

Comments

@bokub
Copy link

bokub commented Oct 22, 2019

Hello,
I have an idea to improve the Dynamic line color feature.

Instead of setting absolute values in the color_thresholds option, it would be great to use relative values.

For example:

  color_thresholds:
    - value: 0%
      color: "#1feaea" # Blue
    - value: 50%
      color: "#ffd200" # Yellow
    - value: 100%
      color: "#f72047" # Red

Or even easier, omitting values

  color_thresholds:
    - color: "#1feaea" # Blue
    - color: "#ffd200" # Yellow
    - color: "#f72047" # Red

image

The goal is that the bottom of the graph is always blue and the top is always red, no matter what the values are.


Technically, this is easy to do in SVG:

<defs>
    <linearGradient id="my-gradient-id" x1="0" y1="1" x2="0" y2="0">
        <stop offset="0" stop-color="#1feaea"></stop>
        <stop offset="0.5" stop-color="#ffd200"></stop>
        <stop offset="1" stop-color="#f72047"></stop>
    </linearGradient>
</defs>
<rect class="line--rect" fill="url(#my-gradient-id)"></rect>
@kalkih kalkih added the feature request New feature or request label Oct 22, 2019
@kalkih
Copy link
Owner

kalkih commented Oct 22, 2019

Thanks, great suggestion!

@jeepotvin
Copy link

Great suggestion. Would it be possible to use dynamic values based on other sensors as threshold? For instance, if I have a sensor that is used as a maximum value, I could use (sensor.my_sensor_max_value - 5) to change line color.

@stale
Copy link

stale bot commented Feb 7, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is still an active issue, please let us know!

@stale stale bot added the stale Stale issue - closed due to inactivity label Feb 7, 2022
@stale
Copy link

stale bot commented Feb 8, 2022

Still an active issue, got it! Removing stale label.

@stale stale bot removed the stale Stale issue - closed due to inactivity label Feb 8, 2022
@jlsjonas jlsjonas added the [Status] Maybe Later We'd love to include this at some point, but it's not on our active roadmap (prevents stale marking) label Feb 9, 2022
@stale
Copy link

stale bot commented Apr 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is still an active issue, please let us know!

@stale stale bot added the stale Stale issue - closed due to inactivity label Apr 10, 2022
@ildar170975 ildar170975 removed the stale Stale issue - closed due to inactivity label Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request [Status] Maybe Later We'd love to include this at some point, but it's not on our active roadmap (prevents stale marking)
Projects
None yet
Development

No branches or pull requests

5 participants