Skip to content

Commit e748072

Browse files
committed
revise gap between title and horizontal legend items
1 parent d7e0ab0 commit e748072

15 files changed

+2
-4
lines changed

src/components/legend/draw.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,6 @@ function computeTextDimensions(g, gd, legendObj, aTitle) {
508508
return;
509509
}
510510

511-
var isVertical = helpers.isVertical(legendObj);
512-
513511
var mathjaxGroup = g.select('g[class*=math-group]');
514512
var mathjaxNode = mathjaxGroup.node();
515513
if(!legendObj) legendObj = gd._fullLayout.legend;
@@ -541,9 +539,9 @@ function computeTextDimensions(g, gd, legendObj, aTitle) {
541539
// approximation to height offset to center the font
542540
// to avoid getBoundingClientRect
543541
if(aTitle === MAIN_TITLE) {
544-
if(!isVertical) {
542+
if(legendObj.title.side === 'left') {
545543
// add extra space between legend title and itmes
546-
width += constants.titlePad * 2;
544+
width += constants.itemGap * 2;
547545
}
548546

549547
svgTextUtils.positionText(textEl,
15 Bytes
Loading
14 Bytes
Loading
2 Bytes
Loading
19 Bytes
Loading
13 Bytes
Loading
Loading
Loading
Loading
Loading
10 Bytes
Loading
Loading
Loading
-4 Bytes
Loading
Loading

0 commit comments

Comments
 (0)