apache / apache/echarts

[Feature] Expose mouse events on legend area or improve mouse events on legend

Open
#20,288 3 comments 3 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?

Improve user experience of a selection in the legend by using double click on a single series:
- to select a single series (if all series are selected), and
- to select all series (if some series are not selected).

This simplifies the UI (because a workaround using `legend.selector` adds additional buttons and has differentiating functionality) and improves the user experience (with `legend.selector: "inv"`, the user has two steps instead of a single dblclick to get to the state of selecting a single series).

### What does the proposed API look like?

- In case of exposing mouse events:
Mouse events are only exposed in the grid area of the chart. They should be also exposed in the legend area. Proposed changes: Add `query: "legend"` to https://echarts.apache.org/en/api.html#echartsInstance.on. The event parameters should then include the clicked series.
- In case of new legend functionality:
No API necessary (could potentially add option to legend whether dblclick should be enabled)

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.