Skip to content

Commit 68848e4

Browse files
committed
Only add traceGap on new rows
1 parent 3edc9eb commit 68848e4

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/components/legend/draw.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ function computeLegendDimensions(gd, groups, traces) {
611611
maxItems = Math.max(maxItems, group.length);
612612
});
613613

614-
maxHeight += opts.tracegroupgap;
615614
maxWidth += traceGap;
616615
maxWidth += 40;
617616

@@ -634,6 +633,8 @@ function computeLegendDimensions(gd, groups, traces) {
634633
var y = ((1 - (length / maxItems)) * maxHeight);
635634
currRowHeight = currRowHeight > (rowNum - 1 * maxHeight) ? (rowNum - 1) * maxHeight : y;
636635

636+
currRowHeight += rowNum > 1 ? traceGap : 0;
637+
637638
rowHeights.push(currRowHeight);
638639
groupXOffsets.push(opts._width);
639640
}
@@ -653,7 +654,7 @@ function computeLegendDimensions(gd, groups, traces) {
653654

654655
Drawing.setTranslate(this,
655656
0,
656-
(5 + borderwidth + groupHeight));
657+
(5 + borderwidth + textHeight / 2) + groupHeight);
657658

658659
groupHeight += textHeight;
659660
});
-539 Bytes
Loading
Loading

0 commit comments

Comments
 (0)