Skip to content

x-unified hover tooltips overflow #5721

Description

@xenatisch

Synopsis

The hover tooltips in x-unified mode exceed max-width and therefore overflow. This happens when:

  • the chart is small and close to the sides
  • the chart is large (near width size) on a small screen - e.g. mobile
  • the tooltip is displayed for a point on the chart that falls near the mid-point of the x-axis

The issue persists in Plotly v2.0.0.

Example

You can see an example of the issue on our live service, provided that your browser width is smaller than ~580px.

Screenshot 2021-06-08 at 14 52 22

Expected behaviour

The hover tooltip x-extrema must always fall between x-extrema of the browser. An even better outcome would be for the tooltip to not spill out of the cartesian axes.

I don't think there's an easy / immediate solution to this, primarily because the tooltip position moves based on cursor position. I suppose one way to address it is to do what folks at Google Charts have done - i.e. move the tooltip until it hits one side, then stop moving horizontally.

Here's an example, which you've probably seen before:

google-sample
[Credit: Google]

Thanks again for all your efforts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions