Is it possible to get, set and lock the range values of the range slider ?
For example, I’d like to always have a range equals to 1 month (assuming my x axis is type=“date”).
Also I’d like to have two buttons below the range slider making possible to “go to the Prev month” (adding -1 month to x0 and x1 values) and “go to the Next month” (adding +1 month to x0 and x1 values).
Which means have access to the x0 and x1 values of the range slider.
I’d like to fix the range of the slider to 1 month.
For example from the “2015-01-01” to the “2015-02-01” (yyyy-mm-dd).
And whatever the user do with the range slider, it will keep a 1 month range.
For example, if you move the left cursor to the “2016-03-05”, the right cursor will automaticly move at the “2016-04-05”.
The range slider works by setting the x-axis to whatever date interval you specify. I have a chart which has buttons for, day, month, 3months,6months, YTD, All etc. When you select say the button for day… it scales the x-axis to 1 day… and when you slide back and forth it stays on the scale of 1 day.
Edit: You can remove the “all” button from my code… i left it there so you could see the syntax for multiple buttons. Note: when sliding - you have to slide from the whited out zone - you should see horizontal arrows to show where to slide from… if you slide in the shaded zone it would drag the range slider to a new custom range.
Thanks a lot.
Is there anyway to make it impossible to drag the range slider to a new custom range ?
Which means if you slide in the shaded zone, it will also slide the other shaded zone keeping the same range.