echarts
echarts copied to clipboard
[Feature] Expose mouse events on legend area or improve mouse events on legend
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)