Display hover text on top instead of to the right · Issue #381 · plotly/plotly.js · GitHub
Skip to content

Display hover text on top instead of to the right #381

Open

Description

@eugenesvk

Hover labels in Plotly are displayed on the right hand side of the displayed object, for example:
plotlyhover

This makes the numbers misaligned, especially for e.g. bar charts, where you'd expect a label to be shown on top of the bar instead of to the right of the bar
plotlyhover2

Is there an option to make the labels appear on top instead? In my second example it would appear in the same position as my current annotations — right on top of the bar. In the first example it should appear on top of the bubble.

Activity

  1. etpinard commented on Apr 1, 2016

    @etpinard
    Contributor

    you'd expect a label to be shown on top of the bar instead of to the right of the bar

    Can I you why you'd expect that, in all cases?

    Is there an option to make the labels appear on top instead?

    Not at the moment. But it would be a nice addition to the library.

  2. eugenesvk commented on Apr 1, 2016

    @eugenesvk
    Author

    Can I you why you'd expect that, in all cases?

    Well, not in all cases, there are exceptions in space-constrained cases e.g. PowerPoint with think-cell (the best ppt addon for charts ever) labels are drawn to the side if there is not enough space inside/on top of the bar, e.g. bar segment is too small to fit a number (see here).
    But in general it's convention (almost all the bar charts display bar values on top), ease of read when information is aligned (great hovertext highlighting partially negates this issue) and just a personal stylistic preference.

  3. chamie commented on Aug 16, 2018

    @chamie

    Can I you why you'd expect that, in all cases?

    Because that way it won't overlap the bar to the right.

  4. gvwilson commented on Jun 5, 2024

    @gvwilson
    Contributor

    Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

  5. eugenesvk commented on Jun 5, 2024

    @eugenesvk
    Author

    Since nothing has changed this is still a concern, though I don't see the point in opening an identical issue for it to be "tidied up" later on when you can just as well add this issue back to the stack

  6. self-assigned this
    on Jun 5, 2024
  7. gvwilson commented on Jun 5, 2024

    @gvwilson
    Contributor

    thanks @eugenesvk - I'll flag it as needing a sponsor and see if we can find someone from the community to work on it. Cheers - @gvwilson

  8. removed their assignment
    on Aug 2, 2024
  9. archmoj commented on Jan 2, 2025

    @archmoj
    Contributor

    How about implementing layout.hoverlabel.position with following values?

    'auto', 
    'top left', 'top center', 'top right',
    'middle left', 'middle center', 'middle right',
    'bottom left', 'bottom center', 'bottom right',
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogcommunitycommunity contributionfeaturesomething new

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions