Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sz-p
Copy link
Contributor

@sz-p sz-p commented Jan 11, 2023

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

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.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

  • Please squash the commits into a single one when merging.

Other information

@echarts-bot echarts-bot bot added PR: awaiting doc Document changes is required for this PR. PR: awaiting review labels Jan 11, 2023
@echarts-bot
Copy link

echarts-bot bot commented Jan 11, 2023

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

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 PR: awaiting doc label.

@oom-
Copy link

oom- commented Oct 9, 2024

Hello, could someone go forward on this ?

Edit: I succeed to "bypass" my issue by subscribing to "highlight" and "downplay" events (kind of hard to guess).

@sz-p
Copy link
Contributor Author

sz-p commented Oct 10, 2024

Waiting for review

Copy link
Contributor

@Ovilia Ovilia left a 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.

@@ -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);
Copy link
Contributor

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: awaiting doc Document changes is required for this PR. PR: awaiting review size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants