Skip to content

BUG: 0 and small values aren't displayed on Bar Chart when textposition is set to auto #6544

Description

@GeorgeFlorian

On the bar chart when there are vastly different values (0, 10 and 200 000 000), the text for 0 and small values won't be displayed.

I need the textposition to be set to auto because on mobile I hide the Y axis labels and put them in the trace.text:

  • if I set it to inside and the bar is small the text will be crammed in there and will not be readable. And because we are on mobile, and the differences in values are very big, the bar will also be too small to touch it to see the hovertemplate;
  • if I set it to outside and the bar is too big, the text will be outside of the viewport. Note that I use cliponaxis: false, but being on mobile means that the viewport is too small.
  • and I can't set the range of the X axis because I use a grouped bar chart with slider and how do you even do that ?

The most simple approach is for textposition: "auto" to display everything and to behave just like it does now.

Here is a minimal example:
https://codepen.io/bleah1/pen/dyqLmvN

I am unable to use annotations because I am using a grouped bar chart with slider and it has this issue: #6543

Activity

  1. changed the title [-]BUG: Small values aren't displayed on Bar Chart[/-] [+]BUG: Small values aren't displayed on Bar Chart; `textposition: outside` isn't taken into account by `automargin`[/+] on Mar 30, 2023
  2. changed the title [-]BUG: Small values aren't displayed on Bar Chart; `textposition: outside` isn't taken into account by `automargin`[/-] [+]BUG: Small values aren't displayed on Bar Chart[/+] on Mar 30, 2023
  3. changed the title [-]BUG: Small values aren't displayed on Bar Chart[/-] [+]BUG: 0 and small values aren't displayed on Bar Chart when `textposition` is set to `auto`[/+] on Mar 30, 2023
  4. self-assigned this
    on Jul 5, 2024
  5. removed their assignment
    on Aug 2, 2024
  6. emilykl commented on Aug 28, 2026

    @emilykl
    Contributor

    Consolidating with #6474 since it seems to be the same issue. I just tested with plotly.js v4.0.0 and can confirm that the bug is still present.

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

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions