File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 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) {
423423 var pushMargin = needsMarginPush ( gd , title , titleHeight ) ;
424424 if ( pushMargin > 0 ) {
425425 applyTitleAutoMargin ( gd , y , pushMargin , titleHeight ) ;
426-
427426 // Re-position the title once we know where it needs to be
428427 titleObj . attr ( {
429428 x : x ,
430429 y : y ,
431430 'text-anchor' : textAnchor ,
432- dy : dy
431+ dy : getMainTitleDyAdj ( title . yanchor )
433432 } ) . call ( svgTextUtils . positionText , x , y ) ;
434433 }
435434 }
@@ -556,6 +555,16 @@ function getMainTitleY(fullLayout, dy) {
556555 }
557556}
558557
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+
559568function getMainTitleTextAnchor ( fullLayout ) {
560569 var title = fullLayout . title ;
561570
You can’t perform that action at this time.
0 commit comments