@@ -77,12 +77,13 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
77
77
coerce ( 'bgcolor' , layoutOut . paper_bgcolor ) ;
78
78
coerce ( 'bordercolor' ) ;
79
79
coerce ( 'borderwidth' ) ;
80
- Lib . coerceFont ( coerce , 'font' , layoutOut . font ) ;
80
+ var itemFont = Lib . coerceFont ( coerce , 'font' , layoutOut . font ) ;
81
81
82
82
var orientation = coerce ( 'orientation' ) ;
83
+ var isHorizontal = orientation === 'h' ;
83
84
var defaultX , defaultY , defaultYAnchor ;
84
85
85
- if ( orientation === 'h' ) {
86
+ if ( isHorizontal ) {
86
87
defaultX = 0 ;
87
88
88
89
if ( Registry . getComponentMethod ( 'rangeslider' , 'isVisible' ) ( layoutIn . xaxis ) ) {
@@ -119,7 +120,11 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
119
120
120
121
var titleText = coerce ( 'title.text' ) ;
121
122
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 : itemFont . size * ( isHorizontal ? 1.2 : 1 )
126
+ } ) ;
127
+
128
+ Lib . coerceFont ( coerce , 'title.font' , dfltTitleFont ) ;
124
129
}
125
130
} ;
0 commit comments