Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬Register for the Oct 27 webinar.

Dash DAQ Gauge: Red to Green to Red

I’m trying to get a gauge quickly indicates to an operator where a process is at relative to a nominal value. To do this, I’d like to be able to go from red to green to red, but I’m not sure how to accomplish this since you define the ranges in a dictionary (can only have 1 “red” key). I tried using a list of ranges and that didn’t help. Any ideas?

daq.Gauge(
            color={
                'gradient':True,
                'ranges':
                    {
                        'red':[0,4],
                        'green':[4,6],
                        **'red':[6,10],**
                    },
            },
            id='ttt',
            showCurrentValue=True,
            units="Nm",
            label='Torque to Turn',
            value=5,
            min=0,
            max=10,
        ),

Hi @ddsmit

You can use the hex color number:

    daq.Gauge(
        color={"gradient":True,"ranges":{"red":[0,4],"green":[4,6],"#FF0000":[6,10]}},
        value=2,
        label='With Gradient',
        max=10,
        min=0,
    ),

and if you want a distinct border instead of a gradient:

   daq.Gauge(
        color={"ranges":{"red":[0,4],"green":[4,6],"#FF0000":[6,10]}},
        value=2,
        label='Without Gradient',
        max=10,
        min=0,
    )

1 Like

Thank you @AnnMarieW ! I’m thinking to create a yellow range too, but I should be able to find the equivalent hex :grinning:

Right - that should work! :grinning:

1 Like