-
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
Docs/clarify usage of ticks callback (#9991) #9994
Conversation
Keep in mind that overriding `ticks.callback` means that you are responsible for all formatting of the label. Depending on your use case, you may want to call the default formatter and then modify its output. In the example above, that would look like: | ||
|
||
```javascript | ||
// call the default formatter, forwarding `this` |
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.
It looks like there's some leading whitespace here which could be removed
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.
I kept the leading whitespace the same as in the example above, to emphasize that the snippet would substitute for return '$' + value;
.
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.
The naming for the ticks array don't match, I think the naming you used now is better as in the example above where it is called values.
So if you could change that it would match better and be more clear.
Per discussion in #9991, this clarifies the responsibilities of ticks callback functions and adds an example.