Skip to content
Merged
Changes from 1 commit
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: 5 additions & 3 deletions src/components/legend/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,15 @@ function computeLegendDimensions(gd, groups, traces) {
maxItems = Math.max(maxItems, group.length);
});

maxHeight += opts.tracegroupgap || 5;
maxHeight += opts.tracegroupgap;
var traceGroupGap = 5;
maxWidth += traceGroupGap;

var groupXOffsets = [opts._width];
var rowHeights = [];
var rowNum = 1;
for(var i = 0, n = groupData.length; i < n; i++) {
opts._width += maxWidth;
opts._width += maxWidth ;

if(fullLayout._size.w < (borderwidth + opts._width + maxWidth)) {
groupXOffsets[groupXOffsets.length - 1] = groupXOffsets[0];
Expand Down Expand Up @@ -669,7 +671,7 @@ function computeLegendDimensions(gd, groups, traces) {
var maxTraceWidth = 0;
var offsetX = 0;
var fullTracesWidth = 0;
var traceGap = opts.tracegroupgap || 5;
var traceGap = 5;

// calculate largest width for traces and use for width of all legend items
traces.each(function(d) {
Expand Down