Skip to content

Show only exact x matches in hover with hovermode="x unified" #4717

Open
@tlauli

Description

@tlauli

Currently, if there are two traces a, b with hovermode="x unified", then a value from trace b can be shown in the hoverinfo even when I am hovering on a x coordinate where there is no point in trace b, but only in trace a, see picture, where hovering over point from trace a with x=3 shows point from trace b with x=3.05.
I would like a way to enforce that only points with exactly matching x coordinates are shown in the hover (something like hovermode="x unified exact"?).

image

Code to generate figure from the screenshot:

fig = go.Figure(
    layout=go.Layout(hovermode="x unified"),
    data=[
        go.Scatter(
            x=[1, 3],
            y=[1, 1],
            name="a",
        ),
        go.Scatter(
            x=[1, 3.05],
            y=[2, 2],
            name="b",
        ),
    ],
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions