Skip to content

Conversation

@doug-a-brunner
Copy link
Contributor

Per discussion in #9991, this clarifies the responsibilities of ticks callback functions and adds an example.

@etimberg etimberg added this to the Version 3.7.0 milestone Dec 15, 2021
etimberg
etimberg previously approved these changes Dec 15, 2021
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`
Copy link
Member

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

Copy link
Contributor Author

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;.

Copy link
Collaborator

@LeeLenaleee LeeLenaleee left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants