question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Outside text relativebarmode confusing when bars disconnected

See original GitHub issue

With relative barmode and {textposition: 'outside'}, outside text will smartly position the text of the first bar as ‘inside’. However, when there are two disconnected bars this results in the text of both bars being ‘inside’. This is not a problem when barmode has the default value.

https://codepen.io/haskellelephant/pen/JmpJMZ

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alexcjohnsoncommented, Oct 24, 2018

Great PR @eivindjahren - I’m always happy to see a one-line change in src backed up by 60 lines of tests!

Another solution is to have ‘outside’ always mean ‘outside’, if you want the smart behavior you use ‘auto’.

Possible, though the existing 'auto' logic depends on the text size relative to the bar height, and ends up meaning “usually inside, but put it outside if we can and the bar is too small” - would be nice to clarify this behavior (for both 'auto' and 'outside') in the textposition description though!

1reaction
eivindjahrencommented, Oct 24, 2018

@alexcjohnson I have made a work in progress PR on my fork (first PR here so needed to conform to the contribution guidelines). It should implement your proposed solution. I still want to test it out a bit more, but hopefully this is in the right direction.

Another solution is to have ‘outside’ always mean ‘outside’, if you want the smart behavior you use ‘auto’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plotly.js in relative barmode labels are overlapped when both ...
Initial Thoughts. One solution is to specify the base parameter for each trace as 0 and for the negative bars use a negative...
Read more >
Bar charts in Python - Plotly
With "relative" barmode, the bars are stacked on top of one another, with negative values below the axis, positive values above. In [31]:....
Read more >
stacked (relative) bar chart: silly stacking order #1395 - GitHub
If I want to plot a stacked bar chart of mixed positive and negative values, say to recreate a likert plot, the order...
Read more >
5.2 Bar chart - Statistique Canada
Horizontal bar charts. One disadvantage of vertical bar charts, however, is that they lack space for text labelling at the foot of each...
Read more >
Clustered & Overlapped Bar Charts with Plotly Express
Clustered (Grouped) Bar Charts display numerical information about the relative proportion that exists between a main category and its ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found