-
-
Notifications
You must be signed in to change notification settings - Fork 497
Be able to draw ticks in a non-linear way #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Indeed, the range of your slider should be divisible by the number of ticks. Currently, there is no way to supply your own ticks but this could actually be a good solution, and quite easy to be done. But this would be for expert users since all the ticks logic should be handle manually (this part). Plus, we could add a For now, you can use the |
@ValentinH Moreover, it doesn't really work with range sliding. Here is my plunker: https://plnkr.co/edit/oCYPzK32rrpf8RP1Q4PM?p=preview If you drag and left handle, the boundary is set correctly. But if you move the range to the left, it goes all the way to the left, passing the boundary (limit) |
Actually, the minLimit/maxLimit is bugged for draggableRange! :D I'll fix that asap. |
@ValentinH In rz-slider-decorator.js, I have overridden the updateTicksScale function and use my own ticks when it's there. In app.js, line 31 to 36, I am just setting up very simple ticks based on my data points. But the ticks and the actually values are not aligning up towards the end when it gets closer to 2016. Do you see anything obvious here regarding to the tick alignment? |
@ValentinH |
@ValentinH Do you see any issues? |
You should use |
@ValentinH However, in my situation, I can no longer click on quarters that are hidden. So I can't go to a particular quarter conveniently. And for the ticks that ARE visible in between the range, the tooltips are still showing up to block the view. And when I slide the range around, the tooltips in the middle are popping up. It would be nice to have an option to disable them totally within the range. And then I can use opacity and be able to click on every available tick outside of the range |
Since you are using a custom ticks array, you can rebuild it at runtime and remove the tooltips that are in the middle of the range... |
This doesn't look good. What I am looking for is to have the ticks showing and have the tooltips disabled. I need to look deeper into this later... |
I was not saying to remove ticks but only their tooltip. But for this, you should not use the default updateTicksScale at all but build your custom one. |
@ValentinH Thanks for looking into this. Is the new code backward compatible with version 5.4.2? I replaced the library and it doesn't look right: https://plnkr.co/edit/MVRnRlYCOGZEnb74yitT?p=preview And then I tried to add draggableRange into your fiddle and couldn't make it work: http://jsfiddle.net/dereklin/c7yvtaqd/ |
You need to update the css file as well because it has changed as well: https://plnkr.co/edit/xPyDhHPIhQ0D9fylbisD?p=preview For the |
@ValentinH Wow, this is great! Even without the custom ticks, the edge tick 2006-12-31 is at the right spot! Thank you very much for the enhancement! |
What do you mean by "without the custom ticks"? Because it's not supposed to change to current behavior 😄 |
Compare my original plunk https://plnkr.co/edit/mdlI5HiUWxJ3rbNlBb4g?p=preview vs the new plunk https://plnkr.co/edit/xPyDhHPIhQ0D9fylbisD?p=preview The only change is using the new slider library. It's already looking like what I want, without using ticksArray. |
Actually the second one is not correct because the ticks are wrongly positioned: this is due to the change on the handles size that is not updated for the ticks positioning... |
Can you explain a little bit more on why it is not correct? It looks pretty good except that 2016 is not displayed at the end of the lower bottom. |
By default, this new feature should not change the current behavior but should enable to change it if the user wants to. So by default, your demo should still be broken but you could fix it. Actually, my previous comment was too quickly written and the current implementation already handles different pointer sizes but your demo was missing a change in your custom CSS: https://plnkr.co/edit/TYcUd2c34flMuKIcrR4z?p=preview Thus you need to set the correct config to ticksArray ;) |
The ticksArray should contain the index of the wanted value: https://plnkr.co/edit/o1r6NElxzunA1Uk2d4NT?p=preview . For now, if you want to ticks to be under the slider, you still need to set a numerical value to |
#426 has been merged so |
Hi,
Thanks for this great library. Everything is working so well so far except for ticks.
Here is my plunker: https://plnkr.co/edit/mdlI5HiUWxJ3rbNlBb4g?p=preview
There are two problem:
Now, in app.js, if I uncomment line 13, the ticks work as expected.
But that's not my true date range. My true date range is with line 13 commented out.
How can I have accurate ticks with my existing data points?
Can I supply my own ticks? Like:
Or, as a compromise, can I uncomment line 13, showing a few "fake" quarters, but have the slider not go into the "fake" quarters -- setting up a boundary?
The text was updated successfully, but these errors were encountered: