Changing marging among legend items

Hi,

I am building a responsive site with Plotly js scatter graphs in it.

To make the graphs responsive, I call the reize and relayout methods on window resize. In relayout, I dynamically calculate font sizes and the graph margin each time to make it look good.

It all resizes nicely except the legend, which keeps a big distance between each of its items. I can’t find how to edit that in layout.

What’s the best way?

We don’t expose a way to do that at the moment, unfortunately. You might want to subscribe to Support for multiple legends · Issue #1668 · plotly/plotly.js · GitHub for related development info.

Hi,

Thanks for the info!

Have a great day!