question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slider labels not showing when keys are float

See original GitHub issue

When I create my slider marks like this:

marks={ 10.0: '10.00%', 25.0: '25.00%', 50.0: '50.00%', 75.0: '75.00%', 100.0: '100.00%' }

the slider labels will not show up. I just get a slider with marks but no labels. The marks still work as expected and will filter the chart according to the keys.

image

Using this:

marks={ 10: '10.00%', 25: '25.00%', 50: '50.00%', 75: '75.00%', 100: '100.00%' }

results in a slider with the proper labels underneath. This slider also works as expected (because my values all have .0 as the decimal value, I suppose).

image

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:12
  • Comments:8

github_iconTop GitHub Comments

9reactions
peterscherpelzcommented, Apr 11, 2018

I’m also having this issue. When the keys are not divisible by 1, it works for the keys to be floats, but when the keys are divisible by 1, marks only appear if the keys used are ints. Because I’m dynamically generating the marks, I’m having to use: marks={int(i) if i % 1 == 0 else i: '{}'.format(i) for i in points_to_mark}

1reaction
crabbixOCEcommented, Sep 23, 2022

@Arpafaucon workaround is good but seriously how is this still a bug? Just had problems with it today, this thread is 4 and a half years old

Read more comments on GitHub >

github_iconTop Results From Across the Web

Range Slider Labels Not Showing - Dash Python
I am having trouble labeling the marks on a range slider component. ... Slider labels not showing when keys are float.
Read more >
Tkinter Scale slider with float values doesn't work with locale ...
Here's a slightly clunky workaround for this bug, using some ideas & code from Bryan Oakley's answer to Dynamically reformat tkinter scale ...
Read more >
PROBLEM with slider with text on both ends and randomization.
questionId+"-"+i+"-label"); var txt = label.textContent; label.innerHTML += "<span style='float: right'>" ...
Read more >
st.slider - Streamlit Docs
Multiple widgets of the same type may not share the same key. help (str). An optional tooltip that gets displayed next to the...
Read more >
How to Use Sliders (The Java™ Tutorials > Creating a GUI ...
The example program provides labels for its slider in this way. But you are not constrained to using only these labels. Customizing Labels...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found