Black Lives Matter. Please consider donating to Black Girls Code today.

Is there a way to display zero on Dash Sliders?

When I pass a dictionary to dcc.Slider marks, zero is not shown although values on either side show up.

dcc.Slider(
    min=-5,
    max=5,
    marks={i: i for i in range(-5,6)},
    value=-3
)

slider

I’m running plotly 2.0.11 and Dash 0.21.0

Thanks!

yikes that looks like a bug. could you try labels as strings instead? {i: str(i) for i in …}

I can confirm that strings as labels work correctly. I have always used str as labels, never thought about using int type or other.

str(i) works - I should have thought of that! :slight_smile: