feat(axis): add customValues
option to customize axis tick/label positions
#19919
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief Information
This pull request is in the type of:
What does this PR do?
Add option
customValues
toaxisTick
andaxisLabel
, which allow the user to specify tick/label positions.This PR is based on #13636 . Since it's a long time since the opening of this PR, I made a few adjustment based on the original commit, with full regards to the contribution to @dvdkon 's contribution.
Fixed issues
#13627
Details
Before: What was the problem?
See issue #13627
After: How is it fixed in this PR?
The new option allows for completely custom tick/label positions, for example:
Usage
Are there any API changes?
In axis:
axisTick.customValues: (string | number | Date)[]
axisLabel.customValues: (string | number | Date)[]
Array of axis values on which a tick/label will be present (automatic tick generation is disabled)
Related test cases or examples to use the new APIs
test/axis-customTicks.html