Black Lives Matter. Please consider donating to Black Girls Code today.
Dash Enterprise delivers an incredible 21x cost savings 💸Download the e-book!

Export image has bars outside the axes

Hi

I have 2 bar charts which are exported to png when clicking on a button. The export works fine (at least on Firefox and Chrome, haven’t tried on any other browser). However here is the catch:

  • bar chart 1, has an yaxis property of ‘tozero’,
  • bar chart 2, has an yaxis range not starting at zero

On the browser both are fine, however on the exported image … bar chart 2 has the bars outside the axes (see image)

both charts go through the same piece of code for the export Plotly.Snapshot.DownloadImage(… )

Did I miss a keyword or something or have I found a bug???

Cheers,

Oh that’s bad.

Can you share a reproducible example of the graph you’re trying to export?

Hi Etienne,

Apparently I have a gift for not being able to reproduce the issue again. … sic…
I can show you a code which does reproduce nearly 90% of my code (and still not the bug) here.

Were I to remove the range option on the yaxis, I would then no longer have that issue…
I don’t know if that helps?

Keep you posted if I manage to make the bug in the fiddle, or get rid of it!

cheers,

That shouldn’t matter, no.