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] tooltip's trigger support series for Pie chart #20581

Open
mortalYoung opened this issue Dec 12, 2024 · 4 comments
Open

[Feature] tooltip's trigger support series for Pie chart #20581

mortalYoung opened this issue Dec 12, 2024 · 4 comments
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.

Comments

@mortalYoung
Copy link

mortalYoung commented Dec 12, 2024

What problem does this feature solve?

  • echarts: 5.5.1

I found the pie chart only support item tooltip.
But if i got a nest pie chart, and i wanted to show then series data when hover the item(highlight current one), it was difficult to do.

I could use my chartData instead of get params from formatter. But it gets some problems when hidden by legend.

Example

What does the proposed API look like?

tooltips:{
    trigger: 'series', // ONLY support for Pie
    formatter:(params: Array) => {
        // do something
        return '';
    }
}
@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 Dec 12, 2024
@Ovilia
Copy link
Contributor

Ovilia commented Dec 12, 2024

What do you expect by setting tooltip.trigger to 'series'?

@mortalYoung
Copy link
Author

What do you expect by setting tooltip.trigger to 'series'?

I can achieve something similar to the Example.

There is one issue with this example is when i hide the data by click legend, it still remains visible on the tooltip.

@Ovilia
Copy link
Contributor

Ovilia commented Dec 16, 2024

Items with the same name are grouped and controlled together in legend. So you may set the same data.name for the items you wish to group together and data.itemStyle.color to set different colors.

@mortalYoung
Copy link
Author

Sorry, I couldn't get your point very much.

As for me, If without 'series' for nested pie chart, I only use a hack way to get the series data and format it to tooltip, so that I could render my series data on tooltip instead of just one item's data.

If echarts could support 'series', then I could get the series data in a formal way and by the way I could fix the issue which I mentioned before.

here is one issue with this example is when i hide the data by click legend, it still remains visible on the tooltip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

2 participants