The Plotly layout docs give many different options for customizing the layout of your graph.
// entrywidth is a fraction, so 0.2 would be 20%. entrywidthmode specifies that entrywidth is a fraction, not pixels.
layout={{width: 320, height: 240, legend: {entrywidth: 0.2, entrywidthmode: "fraction"}}}
2
Answers
The only thing that helps me for now, is to add x value for the legend:
The Plotly layout docs give many different options for customizing the layout of your graph.