Custom labels on DAQ components

Is there any way to customise labels on DAQ components such as the Gauge and Knob?
I’d like to show text labels instead of numbers. Or even hide labels entirely.

I had a look at the APIs for those, but there didn’t seem to be anything obvious…

I haven’t tested this, but my guess is that the scale property can be used for this on both Knob and Gauge.

From the documentation:
scale is a dict with keys:

  • custom (dict; optional): Custom scale marks. The key determines the position and the value determines what will show. If you want to set the style of a specific mark point, the value should be an object which contains style and label properties.custom is a number | dict with keys:
    • label (string; optional)
    • style (string; optional)
1 Like

HI @Wabiloo
@yanboe is correct. You would have to use the custom property here:

from dash import Dash, dcc, html, Input, Output
import dash_daq as daq

app = Dash(__name__)

app.layout = html.Div([
    daq.Gauge(
        id='my-gauge-1',
        value=6,
        scale={'custom':{5:'five', 6:'six', 7:'seven'}}
    ),
    dcc.Slider(
        id='my-gauge-slider-1',
        min=0,
        max=10,
        step=1,
        value=6
    ),
])

@app.callback(Output('my-gauge-1', 'value'), Input('my-gauge-slider-1', 'value'))
def update_output(value):
    return value

if __name__ == '__main__':
    app.run_server(debug=True)

1 Like