[Feature] [axis] add alignTicks for mutliple axis alignment.#16300
Merged
[Feature] [axis] add alignTicks for mutliple axis alignment.#16300
Conversation
|
Thanks for your contribution! The pull request is marked to be Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
|
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
This PR adds
alignTicksoption to allow ticks alignment between multiple value or log axis.Similar PR: #13210
How it Works
When a value/log axis is set to
alignTicks: true. It will find the first value/log axis on the same dimension that is not usealignTicksand align the ticks to it.The align algorithm is bacially from radar series, which already has ticks alignment between multiple indicator axes, with some enhancement on the corner cases. The simple idea is find a good interval that having minimal extent that can contain the data. Here is a detail explaination
splitNumberisticksNumber - 1extentandintervalwith thissplitNumberusingcalcNiceExtent.minandmaxare both fixed. It will simply calculate theintervalby(max - min) / splitNumbermaxis fixed. Try to calculateminbymax - interval * splitNumber.intervalis from the second step. If the calculatedminis larger than the minimal value. Increase interval utilminis less than the minimal value.minis fixed. Similar tomaxfixed case.minandmaxare not fixed. Setmaxtoextent[1]calculated from the second step. Then it's similar to themaxfixed case. Note if the calculatedminandmaxcross the zero value. We need to check if the data extent cross and make sure they are both positive or negative.minormax. We need to adjust the calculatedminandmaxproportionally.Limitations
alignTickswith complexmin,maxvalue, e.g.'dataMin','dataMax', will lead to unreadable ticks.Fixed issues
#11390
#10928
Details
Before: What was the problem?
After: How is it fixed in this PR?
More conformance tests
Misc
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information