-
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
fix(type): add overflow property to AxisLabelBaseOption interface. close #17363 #17808
Conversation
Thanks for your contribution! |
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.
It seems a lot of attributes of LabelOption
should not be included in AxisBaseOptionCommon
. So it's probably not a good idea to extend it. Add overflow?: TextStyleProps['overflow']
to AxisBaseOptionCommon
may be enough.
apache#17363 Co-authored-by: Giulio Mazzanti <gmazzanti@protonmail.com>
Agreed, I've done the requested changes |
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
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 theTextCommonOption
insted ofLabelOption
which is already extendingTextCommonOption
overflow
property, 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 insideLabelOption
https://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
overflow
property on xAxis.axisLabel without getting a type error.The issue was fixed by changing the interface thatAxisLabelBaseOption
was extending fromTextCommonOption
toLabelOption
, as wrote beforeLabelOption
is already extendingTextCommonOption
.I have also removed from
AxisLabelBaseOption
the property that were already available inLabelOption
.The issue was fixed by adding the
overflow
property toAxisLabelBaseOption
, copying the type ofoverflow
fromTextStyleProps
.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