Skip to content

fix(bar): prevent outside text labels from overlapping tilted axis ticks#7872

Open
vizansh wants to merge 1 commit into
plotly:masterfrom
vizansh:fix-bar-label-overlap
Open

fix(bar): prevent outside text labels from overlapping tilted axis ticks#7872
vizansh wants to merge 1 commit into
plotly:masterfrom
vizansh:fix-bar-label-overlap

Conversation

@vizansh

@vizansh vizansh commented Jun 27, 2026

Copy link
Copy Markdown

Fixes #7822

This pull request dynamically calculates the positioning for bar chart text labels when textposition='outside'.

Instead of using a static pixel margin, it looks up the active axis configuration and utilizes .getBBox() to measure the exact live dimensions of the tilted or long axis labels. It then shifts the bar numbers by that precise footprint plus a clean visual buffer, entirely preventing overlaps with the top/right axis ticks.

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.

[BUG]: Bar labels overlap with top/right axis labels with textposition=outside

1 participant