Skip to content

Category-axis bar chart has incorrect width if category label equals endpoint of autocomputed range #4812

Closed
@airtable-MartinMichelsen

Description

For bar charts with category-labeled x axes, Plotly automatically computes an x-axis range based on the number of bars in the chart, which seems to be [-0.5, numBars - 0.5]. The chart doesn't render properly if one of the range endpoints happens to be equal to a category name. In the following example, the graph is cut off with the bar labeled '2.5' being partially out of frame and the bar labeled '3.0' not rendering at all:
https://codepen.io/mmichelsen/pen/LYpebKj

If you change '2.5' to anything other than '-0.5' or '2.5', the graph renders properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions