Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/legend/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,18 @@ function computeLegendDimensions(gd, groups, traces) {
opts.height = 0;
var rowHeight = 0,
maxTraceHeight = 0,
maxTraceWidth = 0,
offsetX = 0;

//calculate largest width for traces and use for width of all legend items
traces.each(function(d) {
maxTraceWidth = Math.max(40 + d[0].width, maxTraceWidth);
});

traces.each(function(d) {

var legendItem = d[0],
traceWidth = 40 + legendItem.width,
traceWidth = maxTraceWidth,
traceGap = opts.tracegroupgap || 5;

if((borderwidth + offsetX + traceGap + traceWidth) > (fullLayout.width - (fullLayout.margin.r + fullLayout.margin.l))) {
Expand Down