✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Dash Gauge change color of value when using color range

Hi all,

I’m trying to make a temperature dial, with a color range. Does anyone know how i can have the value displayed change color? I’ve attached example code, where the color changes when no range is set - but when a range is set the number defaults back to blue.

Thanks

image

import dash
import dash_daq as daq
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State

random_temperature = 18

app = dash.Dash(name,)

app.layout = html.Div([
daq.Gauge(
id=‘test-gauge’,
label=“Test 1”,
value=random_temperature,
min=-10,
max=35,
showCurrentValue=True,
units=“Celsius”,
),
daq.Gauge(
id=‘second-test-gauge’,
label=“Test 2”,
value=random_temperature,
min=-10,
max=35,
color={“gradient”:False,“ranges”:{“green”:[-10,15],“yellow”:[15,25],“red”:[25,35]}},
units=“Celsius”,
showCurrentValue=True,
),
])

if name == ‘main’:
app.run_server(debug=True)