• Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

106
Views
Is there a way to Add TICKS/Labels in RangeSlider for Plotly (javascript)?

I have a line chart that uses Range slider and I want to just add some ticks/labels below the range slider. I've search PLOTLY docs but couldn't seem to find a parameter to imply ticks to the chart. Any insights?

enter image description here

9 months ago · Juan Pablo Isaza
1 answers
Answer question

0

Javascript

With the regular slider, we can set a label to each of the defined steps, but it seems there is no possibility to do the same with the rangeslider.


Python

You can use the marks property to set labels (and optionally add styles or even restrict which values can be selected), eg. :

dcc.RangeSlider(
    min=min,
    max=max,
    step=1,
    marks={ m: str(m) for m in range(min, max+1) },
    value=[min, max]
)

Note :

If slider marks are defined and step is set to None then the slider will only be able to select values that have been predefined by the marks. Note that the default is step=1, so you must explicitly specify None to get this behavior.

@see Marks and Steps

9 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.