fix(type): add overflow property to AxisLabelBaseOption interface. close #17363 #17808
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 [email protected]
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