color_threshold
colors are incorrect when also configuring the y-axis.
#763
Labels
bug
Something isn't working
Checklist
Describe the bug
The gradient applied by
color_threshold
appears to be calculated over the range of sensor values, rather than the actual y-axis values. So they are correct if the y-axis is auto-generated, but incorrect if the y-axis scale is configured with a specific minimum, or if another series is also displayed. The screenshots below demonstrate this best.Version of the card
Version: 2.1.2
To Reproduce
This is the configuration I used:
Screenshots
This screenshot shows it working correctly.
Note that
color_threshold
is set with overlapping values at 30, to create a hard division between green and red at 30.The resulting gradient goes from a light green, through the hard transition to red, and up to a little bit of black.
This screenshot is the exact same data and configuration, except the a y-axis set for 0 to ~50.
You can see that it gets the exact same gradient applied. The hard division happens around 14 instead of 30, and the low-end colors don't appear.
This screenshot adds another series which extends the axis, instead of configuring it manually.
Again the same gradient is applied. Notice that the hard division happens around 27.5.
Expected behavior
I expect the color gradient to match the configured values, regardless of y-axis scale.
Desktop:
Smartphone:
Additional context
N/A
The text was updated successfully, but these errors were encountered: