-
Notifications
You must be signed in to change notification settings - Fork 19.8k
[Feature] [axis] add alignTicks for mutliple axis alignment. #16300
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
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 |
Ovilia
left a comment
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.
LGTM
|
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |

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