Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not ovelap hoverlabels for different tracetypes #6954

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mbant
Copy link

@mbant mbant commented Apr 10, 2024

This PR attempts a fix for #6917 which reported excessive hoverlabel removal and overlap for plots with both scatter and bar traces.

Behaviour before the fix:

Screenshot 2024-04-10 at 21 54 14

or even

Screenshot 2024-04-10 at 21 56 01

Behaviour after the fix:

Screenshot 2024-04-10 at 21 51 35
JSON file used for the example
{
  "data": [
    {
      "name": "scatter_1",
      "type": "scatter",
      "y": [0, 1, 2],
      "x": ["CAT 1", "CAT 2", "CAT 3"]
    },
    {
      "name": "bar_1",
      "type": "bar",
      "y": [0, 1, 2],
      "x": ["CAT 1", "CAT 2", "CAT 3"]
    },
    {
      "name": "scatter_2",
      "type": "scatter",
      "x": ["CAT 1", "CAT 2", "CAT 3"],
      "y": [0, 1, 2]
    },
    {
      "name": "bar_2",
      "type": "bar",
      "y": [0, 1, 2],
      "x": ["CAT 1", "CAT 2", "CAT 3"]
    },
    {
      "name": "scatter_3",
      "type": "scatter",
      "x": ["CAT 1", "CAT 2", "CAT 3"],
      "y": [0, 1, 2]
    },
    {
      "name": "bar_3",
      "type": "bar",
      "y": [0, 1, 2],
      "x": ["CAT 1", "CAT 2", "CAT 3"]
    }
  ],
  "layout": {
    "width": 600,
    "height": 400,
    "hovermode": "x"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant