apache / apache/echarts

[Feature] Tooltip triggered by area hover

Open
#21,280 2 comments 0 reactions 0 assignees View on GitHub
en new-feature pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

I need to have a specific series tooltip appear when user hovers over an area in an area chart. Currently it seems you can only use the triggerLineEvent, which requires you to hover over the specific point in the line.

To workaround this requires rebuilding some of the detection logic based on mouse position, which will be fragile and complex.

This seems like a basic expected feature for an end user of a chart.

I need the same for bars, but it is easier to build the custom logic for bars so I am not blocked on that, though having the ability to combine both trigger axis and item in a multi-series bar chart would be great (hover over axis show all series; hover over segment show just that segment's values).

I am already going to have to build custom logic for line charts to detect the closest line to the cursor, but I can't use that for areas because closest line would give you the wrong output for an area

### What does the proposed API look like?

I am not sure what the API should look like, but I would consider this behaviour to be the desired default behaviour for stacked charts, so maybe it is a new "trigger" option in addition to "axis" and "item" ("hybrid"?)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.