Skip to content

[Feature] More control over when line events trigger #21000

Open
@sjcobb

Description

@sjcobb

What problem does this feature solve?

Currently, triggerLineEvent is very useful but there are cases where you only want to trigger the event when hovering on the actual line not the area under the curve. This comes up in cases where there are overlapping series with areaStyle set (ex: you want to hover only on the line and have the event trigger for the series you're closest to, disregarding whether it is plotted on top). A workaround for overlapping series is to use zlevel but ideally, we'd have more control over the event.

Example where hovering under the line triggers the mouse event:

ex_area_hover.mov

Example where bold series in tooltip does not stay in sync with the correct line being hovered over (using triggerLineEvent: true):

test_tooltip_bold_series_ex_02.mov

What does the proposed API look like?

Add a new triggerLineOnlyEvent option to line series. When it is true, only hovering on the actual line will trigger the mouse event.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enThis issue is in Englishnew-featurependingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions