-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Add reverse support to category scale #6342
Conversation
Added a boundary check at the end of |
Just FYI, I did something similar the other day. Handled the reverse thing in core.scale. Its based on layout refactor, so can't PR yet (also not near computer for weekend) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may also be able to use the new method in scale.linear/logarithmic.getPixelForValue/getValueForPixel
convertTicksToLabels: function() { | ||
var me = this; | ||
|
||
me._tickValues = me.ticks.slice(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we either make this not necessary or add a comment explaining why it's needed? it seems redundant to me that we would store ticks in both ticks
and _tickValues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment added. The labels need to be stored because they can be modified by the user callback while getPixelForValue
requires the original label value.
|
@kurkle I'm happy to review your code once the layout refactoring completes. |
4201620
to
7d9f281
Compare
Any updates on this ? |
This PR adds
ticks.reverse
support to category scale as well as the refactoring discussed in #6323 (comment).This PR: https://jsfiddle.net/nagix/at8vfh6x/
![Screen Shot 2019-06-15 at 5 31 47 PM](https://user-images.githubusercontent.com/723188/59549707-452cb380-8f94-11e9-8103-1d09a716dac9.png)
Closes #3306