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

[Feature] How to highlight both ancestor and descendant nodes of hover simultaneously #20397

Closed
sentimental114 opened this issue Oct 8, 2024 · 6 comments · Fixed by #20399
Closed
Labels
difficulty: easy Issues that can be fixed more easily than the average. en This issue is in English new-feature topic: sunburst

Comments

@sentimental114
Copy link

What problem does this feature solve?

Now I have a requirement to highlight both the ancestor and descendant nodes of the current hover, but the configuration item can only be selected as a single option. How can I implement it? Thanks

What does the proposed API look like?

Can a new configuration be added to the configuration item to enable this feature

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Oct 8, 2024
@plainheart
Copy link
Member

If it's the tree series, you can set emphasis.focus as 'relative' to highlight ancestor and descendant nodes.

@sentimental114
Copy link
Author

微信图片_20241008140647
I have tried this before, and it seems to have a bug. When using this configuration, it turns into highlighting itself. The same effect as using 'self' configuration

@plainheart
Copy link
Member

The sunburst series doesn't support 'relative' yet. You can open a PR to add support for this feature, just like #17009.

@plainheart plainheart added topic: sunburst difficulty: easy Issues that can be fixed more easily than the average. and removed pending We are not sure about whether this is a bug/new feature. labels Oct 8, 2024
Copy link

echarts-bot bot commented Oct 8, 2024

This issue is labeled with difficulty: easy.
@sentimental114 Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.

Please have a look at How to debug ECharts if you'd like to give a try. 🤓

@MatthiasMert
Copy link

MatthiasMert commented Oct 8, 2024

You can also implement it on top using mouse events and modifying the itemStyle accordingly.

Make sure you set emphasis: {focus: 'none'} when using this approach.

Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy Issues that can be fixed more easily than the average. en This issue is in English new-feature topic: sunburst
Projects
None yet
3 participants