kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3k stars 233 forks source link

Change color line graph with value #943

Closed DonCastor closed 1 year ago

DonCastor commented 1 year ago

Hello Community !

I'm trying to do a simple thing, but it seems that i'm taking it on the wrong side!

I have created cards where I display temperature and humidity of the room (on that no issue). The temperature icon, is colored with different values as you can see below :

image It's working fine and I have the right color with the right temperature. But when I want to apply this scheme to my mini-graph-card, it's not working : I just want to have my graph-line with the same color as my icon...

For that, here is the code :

image

This is driving me crazy, I'm sure it can work, but I don't understand why it is not.

If any of you has any idea ? I would appreciate !

ildar170975 commented 1 year ago

Already supported by color_thresholds

DonCastor commented 1 year ago

Already supported by color_thresholds

Hi,

The color_treshold behaviour is not what I want. I want the whole graph to be from the color I put in parameter, not the threshold.

For example, If my temperature is 19, I want the whole graph line in green. If my temperature is 22, I want the whole line to be in red.

This is the difference between the treshold and my question.

Regards,

ildar170975 commented 1 year ago

For example, If my temperature is 19, I want the whole graph line in green. If my temperature is 22, I want the whole line to be in red.

I see. Then I suggest you to add your comments here - https://github.com/kalkih/mini-graph-card/issues/697 That issue is about a possibility to use templates for options.