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

The graph line goes black if color_thresholds are set with value out of currently displayed range #606

Closed
Sindar-sudo opened this issue May 18, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@Sindar-sudo
Copy link

Hi!
The custom card is great! However, I ran into a slight problem.
If I set color_thresholds with values that are not currently in the range of the visible graph with the default color_thresholds_transition: smooth, the graph does not transition to the specified color, but instead fades to black.
If I set it to color_thresholds_transition: hard or if I set lower/upper_bound, it works as expected, however, using these is not ideal.

Here's my config:

type: 'custom:mini-graph-card'
entities:
  - entity: sensor.temperature
hours_to_show: 24
refresh_interval: 1
color_thresholds:
  - value: 18
    color: blue
  - value: 21
    color: green
  - value: 23
    color: red
color_thresholds_transition: smooth

This is what it looks like:
image

@Sindar-sudo
Copy link
Author

Sindar-sudo commented May 18, 2021

This apparently only works this way with color names (e.g., "red"). When defining colors with hex codes (#FF0000), it works as expected.

@kalkih kalkih added the duplicate This issue or pull request already exists label May 19, 2021
@kalkih
Copy link
Owner

kalkih commented May 19, 2021

Hello,
Yes, only hex format is officially supported, other format could in some cases.
See #236.

@kalkih kalkih closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants