File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -423,13 +423,12 @@ exports.drawMainTitle = function(gd) {
423
423
var pushMargin = needsMarginPush ( gd , title , titleHeight ) ;
424
424
if ( pushMargin > 0 ) {
425
425
applyTitleAutoMargin ( gd , y , pushMargin , titleHeight ) ;
426
-
427
426
// Re-position the title once we know where it needs to be
428
427
titleObj . attr ( {
429
428
x : x ,
430
429
y : y ,
431
430
'text-anchor' : textAnchor ,
432
- dy : dy
431
+ dy : getMainTitleDyAdj ( title . yanchor )
433
432
} ) . call ( svgTextUtils . positionText , x , y ) ;
434
433
}
435
434
}
@@ -556,6 +555,16 @@ function getMainTitleY(fullLayout, dy) {
556
555
}
557
556
}
558
557
558
+ function getMainTitleDyAdj ( yanchor ) {
559
+ if ( yanchor === 'top' ) {
560
+ return alignmentConstants . CAP_SHIFT + 0.3 + 'em' ;
561
+ } else if ( yanchor === 'bottom' ) {
562
+ return '-0.3em' ;
563
+ } else {
564
+ return alignmentConstants . MID_SHIFT + 'em' ;
565
+ }
566
+ }
567
+
559
568
function getMainTitleTextAnchor ( fullLayout ) {
560
569
var title = fullLayout . title ;
561
570
You can’t perform that action at this time.
0 commit comments