Direct labels on bar chart not fully visible

Hi all,

I’ve recently changed the Plotly/Dash app I’m currently working on to display the numbers on the chart, instead of relying solely on hover information. This works great most of the time, but there is an edge case that I seem to run into more and more often recently.

Screenshot%20from%202019-09-23%2015-59-32

Sometimes, the numbers are slightly off screen and you can’t see the actual value, unless you hover over. But the issue still exists if you want to download the chart as a PNG for example.

I’ve put an example together here using Plotly JS: https://codepen.io/andrap/pen/yLBZybm

I thought about opening up a bug on GitHub for this one, but I was wondering if anyone has come across this before? Is there a way to force the labels to be contained within the visible graph display area?

Thanks,
Andra