I’m finding that if I download a png image of a plot on my dash app it cuts off the legend if its a bit longer than normal (see image).
It renders fine on the app but when I click the download plot as png the problem occurs.
I’ve tried playing around with the legend location and the margin of the plot but it makes no difference, even if the legend is in the middle of the plotting area I still get the same problem.
I’ve set that and there same problem still occurs - I’ve also tried explicitly setting a height and width to see if I could make the plot big enough but the same problem still occurs.
I’ve got round this for now by just having shorter labels in the legend but not sure thats a long term solution
I can’t seem to recreate the problem with a simple example. Do you think this could be something to do with my CSS layout? The plots are in divs which I’ve made set sizes and I wonder if that could affect the image? Although I would have thought that would just change the rendering on the browser.
I also had the attribute ‘scale’ in the ‘toImageButtonOptions’ set to ‘scale’:2. I’ve played around with that but it doesn’t seem to change the legend either.
Hi @dig , @bigmike, this is possibly ancient history for you both now, but I eventually found a workaround to this issue from another forum and I wanted so share it in case is is useful: simply pad your legend string with sufficient trailing spaces and it should display the full text. Admittedly, not an elegant solution but it is good enough for what I need, plus I couldn’t afford the time to figure out what elements on my page were causing Plotly issues in my case.
I have no idea if this is still on anyones radar…but I’m having the same issue except with axis text. I have a horizontal bar graph where some of the axis text is being cut off. Adding axis titles or anything else doesn’t seem to help at all.
For anyone else stumbling across this in the future - I was able to fix this for our application by changing and specifying the font - I used a monospaced font in our case. Hope it helps someone else one day.