-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
[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 |
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
alignTicks
option 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 usealignTicks
and 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
splitNumber
isticksNumber - 1
extent
andinterval
with thissplitNumber
usingcalcNiceExtent
.min
andmax
are both fixed. It will simply calculate theinterval
by(max - min) / splitNumber
max
is fixed. Try to calculatemin
bymax - interval * splitNumber
.interval
is from the second step. If the calculatedmin
is larger than the minimal value. Increase interval utilmin
is less than the minimal value.min
is fixed. Similar tomax
fixed case.min
andmax
are not fixed. Setmax
toextent[1]
calculated from the second step. Then it's similar to themax
fixed case. Note if the calculatedmin
andmax
cross the zero value. We need to check if the data extent cross and make sure they are both positive or negative.min
ormax
. We need to adjust the calculatedmin
andmax
proportionally.Limitations
alignTicks
with complexmin
,max
value, 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