fix(type): add overflow property to AxisLabelBaseOption interface. close #17363#17808
Merged
Ovilia merged 1 commit intoapache:masterfrom Oct 27, 2022
Merged
fix(type): add overflow property to AxisLabelBaseOption interface. close #17363#17808Ovilia merged 1 commit intoapache:masterfrom
Ovilia merged 1 commit intoapache:masterfrom
Conversation
|
Thanks for your contribution! |
Ovilia
requested changes
Oct 25, 2022
apache#17363 Co-authored-by: Giulio Mazzanti <gmazzanti@protonmail.com>
Contributor
Author
Agreed, I've done the requested changes |
Ovilia
approved these changes
Oct 27, 2022
|
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.
Co-authored-by: Giulio Mazzanti gmazzanti@protonmail.com
Brief Information
This pull request is in the type of:
What does this PR do?
This PR sets the correct interface that AxisLabelBaseOption extends, changing it from TextCommonOption to LabelOption.This PR adds the overflow property to the AxisLabelBaseOption interface.
Fixed issues
Details
Before: What was the problem?
The overflow property on xAxis.axisLabel works fine as you can see from this demo: Chart demo
The actual issue is with the type of
xAxis.axisLabel(AxisLabelBaseOption)that is extendingwhich is missing theTextCommonOptioninsted ofLabelOptionwhich is already extendingTextCommonOptionoverflowproperty, resulting in a type error if We try to use that property in a typescript file.If We look at the documentation We can see that the overflow property is available with all the others properties insideLabelOptionhttps://echarts.apache.org/zh/option.html#xAxis.axisLabel.overflowAfter: How does it behave after the fixing?
After setting the correct type We can use the
overflowproperty on xAxis.axisLabel without getting a type error.The issue was fixed by changing the interface thatAxisLabelBaseOptionwas extending fromTextCommonOptiontoLabelOption, as wrote beforeLabelOptionis already extendingTextCommonOption.I have also removed from
AxisLabelBaseOptionthe property that were already available inLabelOption.The issue was fixed by adding the
overflowproperty toAxisLabelBaseOption, copying the type ofoverflowfromTextStyleProps.Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information