echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] Tooltip missing trigger: stack

Open pf18387 opened this issue 5 months ago • 6 comments

What problem does this feature solve?

Context: A very basic chart showing bars with 5 (or N) series (activities), 2 (or N) stacks (people) , and several categories (weeks). There is a jsfiddle https://jsfiddle.net/j6e19myk/1/ showing a working example.

All works fine thanks to your excellent work.

Feature: All works fine, but the tooltip. I'd like a kind of option like "trigger: stack" so the tooltip could display only the values belonging to the stack being under the mouse. Unless my data should be rearranged but I can't imagine how, since the results are as expected.

Best regards Pierre.

What does the proposed API look like?

This is only a feature request.

pf18387 avatar Jun 17 '26 16:06 pf18387

I’d like to work on this. Would you prefer a new trigger: 'stack' option, or should this behavior extend an existing tooltip option?

jeevanabhi-r avatar Nov 22 '26 09:11 jeevanabhi-r

I’d like to work on this. Would you prefer a new trigger: 'stack' option, or should this behavior extend an existing tooltip option?

Actuallly, the simpler the better.

pf18387 avatar Nov 22 '26 09:11 pf18387

I made a demo using the existing tooltip.formatter: https://jsfiddle.net/nL1y7sro/2/. Hovering a bar shows only the values from that stack for the selected week. Would a documented example like this meet your needs?

jeevanabhi-r avatar Nov 22 '26 10:11 jeevanabhi-r

Looks perfect to me! Thanks.

pf18387 avatar Nov 22 '26 10:11 pf18387

Glad it works! Would the maintainers welcome this as an official example for stacked bar tooltips? I’d be happy to contribute it.

jeevanabhi-r avatar Nov 22 '26 10:11 jeevanabhi-r

Hi! Would a small documentation PR showing how to use tooltip.formatter for stack-specific tooltips be useful? If so, where would you prefer the example to go?

jeevanabhi-r avatar Nov 23 '26 14:11 jeevanabhi-r