-
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(legend): fix dataItem undefined error #18390
base: master
Are you sure you want to change the base?
Conversation
Hi. Thanks for your contribution. If this PR doesn't have a related issue to describe the problem, please provide an online link with Official Editor, CodePen, CodeSandbox or JSFiddle for the reviewer to understand the problem. Thanks! |
This pr is to fixed the null error by this commit: 4fe4561 In the same option, v5.4.0 can display it while v5.4.1 cannot. Echarts v5.4.0: https://codepen.io/roojay/pen/jOvvmQV Echarts v5.4.1 is error: https://codepen.io/roojay/pen/MWqqmZo |
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.
Thanks for your contribution. I think we only have a small problem here.
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.
The source code change looks good to me. Please add a case in https://github.com/apache/echarts/blob/master/test/legend.html
dfe8f5a
to
b935760
Compare
@Ovilia test case added. |
Brief Information
This pull request is in the type of:
What does this PR do?
Fix LegendModel error when dataItem is undefined
Fixed issues
Details
Before: What was the problem?
The possibility of
dataItem
being empty was not taken into consideration here, and itsname
is directly retrieved:After: How does it behave after the fixing?
Exclude empty
dataItem
and empty legend names.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