@@ -77,12 +77,13 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
7777 coerce ( 'bgcolor' , layoutOut . paper_bgcolor ) ;
7878 coerce ( 'bordercolor' ) ;
7979 coerce ( 'borderwidth' ) ;
80- Lib . coerceFont ( coerce , 'font' , layoutOut . font ) ;
80+ var itemFont = Lib . coerceFont ( coerce , 'font' , layoutOut . font ) ;
8181
8282 var orientation = coerce ( 'orientation' ) ;
83+ var isHorizontal = orientation === 'h' ;
8384 var defaultX , defaultY , defaultYAnchor ;
8485
85- if ( orientation === 'h' ) {
86+ if ( isHorizontal ) {
8687 defaultX = 0 ;
8788
8889 if ( Registry . getComponentMethod ( 'rangeslider' , 'isVisible' ) ( layoutIn . xaxis ) ) {
@@ -119,7 +120,11 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
119120
120121 var titleText = coerce ( 'title.text' ) ;
121122 if ( titleText ) {
122- coerce ( 'title.side' , orientation === 'h' ? 'left' : 'top' ) ;
123- Lib . coerceFont ( coerce , 'title.font' , layoutOut . font ) ;
123+ coerce ( 'title.side' , isHorizontal ? 'left' : 'top' ) ;
124+ var dfltTitleFont = Lib . extendFlat ( { } , itemFont , {
125+ size : Lib . bigFont ( itemFont . size )
126+ } ) ;
127+
128+ Lib . coerceFont ( coerce , 'title.font' , dfltTitleFont ) ;
124129 }
125130} ;
0 commit comments