-
Notifications
You must be signed in to change notification settings - Fork 19.7k
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(legend): symbolRotate for legend is neither inherited nor being set #20562
base: master
Are you sure you want to change the base?
Conversation
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20562@3af0b83 |
src/component/legend/LegendView.ts
Outdated
@@ -404,7 +404,8 @@ class LegendView extends ComponentView { | |||
} | |||
else { | |||
// Use default legend icon policy for most series | |||
const rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') | |||
const rotate = (!legendIconType || legendIconType === 'inherit') |
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.
I think this may not be quite accurate.
Consider the series that doesn't have seriesModel.getLegendIcon
, like pie series, with legend.symbolRotate = 30
, we may probably expect the legend icon is a roundRect
with rotation of 30 degrees. But instead, the current implementation uses 0. I didn't consider this situation when in my previous PR. Can you help fix this?
My guess would be something like zrUtil.retrive2(seriesModel.getData().getVisual('symbolRotate'), iconRotate)
but you may need to figure out what works by doing more tests.
Thanks!
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.
OK I will test more.
Brief Information
This pull request is in the type of:
What does this PR do?
Fixed issues
#20559
#17955
Details
Before: What was the problem?
symbolRotate
for legend is neither inherited nor being set in case of scatter series.After: How does it behave after the fixing?
symbolRotate
work well in legendDocument 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