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)
1 Like

Hi there, did you find the answer?