-
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
feat(legend): add legendmouseover legendmouseout event (#18144) #18164
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
Waiting for review |
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.
Sorry for the late review. I think this PR is generally good. Please merge from the master to resolve the conflict and I'll have a quick review again. Please also add a test case.
src/component/legend/legendAction.ts
Outdated
@@ -37,6 +37,9 @@ function legendSelectActionHandler(methodName, payload, ecModel) { | |||
else if (methodName === 'allSelect' || methodName === 'inverseSelect') { | |||
legendModel[methodName](); | |||
} | |||
else if (methodName === 'legendMouseover' || methodName === 'legendMouseout') { | |||
isSelected = legendModel.isSelected(payload.name); |
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.
This is perhaps no longer needed. You make merge the current master code and have a double check.
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.
You should update the LegendSelectMethodNames
after merging from master.
4a0eebc
to
eb975b0
Compare
Brief Information
This pull request is in the type of:
What does this PR do?
add legend event
legendmouseover
legendmouseout
Fixed issues
#18144
Details
Before: What was the problem?
Stop data carousel when mouse hover on legend must customizing legend elements with HTML
see demo:
https://codepen.io/plainheart/pen/xxJRdam
After: How does it behave after the fixing?
Stop data carousel with legend event
legendmouseover
legendmouseout
see demo:
https://stackblitz.com/edit/js-q9vzb5?file=index.js
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