@@ -486,7 +486,8 @@ function _hover(gd, evt, subplot) {
486
486
rotateLabels : rotateLabels ,
487
487
bgColor : bgColor ,
488
488
container : fullLayout . _hoverlayer ,
489
- outerContainer : fullLayout . _paperdiv
489
+ outerContainer : fullLayout . _paperdiv ,
490
+ commonLabelOpts : fullLayout . hoverlabel
490
491
} ;
491
492
492
493
var hoverLabels = createHoverText ( hoverData , labelOpts ) ;
@@ -528,6 +529,7 @@ function createHoverText(hoverData, opts) {
528
529
var bgColor = opts . bgColor ;
529
530
var container = opts . container ;
530
531
var outerContainer = opts . outerContainer ;
532
+ var commonLabelOpts = opts . commonLabelOpts || { } ;
531
533
532
534
// opts.fontFamily/Size are used for the common label
533
535
// and as defaults for each hover label, though the individual labels
@@ -577,9 +579,17 @@ function createHoverText(hoverData, opts) {
577
579
ltext = label . selectAll ( 'text' ) . data ( [ 0 ] ) ;
578
580
579
581
lpath . enter ( ) . append ( 'path' )
580
- . style ( { fill : Color . defaultLine , 'stroke-width' : '1px' , stroke : Color . background } ) ;
582
+ . style ( {
583
+ fill : commonLabelOpts . bgcolor || Color . defaultLine ,
584
+ stroke : commonLabelOpts . bordercolor || Color . background ,
585
+ 'stroke-width' : '1px'
586
+ } ) ;
581
587
ltext . enter ( ) . append ( 'text' )
582
- . call ( Drawing . font , fontFamily , fontSize , Color . background )
588
+ . call ( Drawing . font ,
589
+ commonLabelOpts . font . family || fontFamily ,
590
+ commonLabelOpts . font . size || fontSize ,
591
+ commonLabelOpts . font . color || Color . background
592
+ )
583
593
// prohibit tex interpretation until we can handle
584
594
// tex and regular text together
585
595
. attr ( 'data-notex' , 1 ) ;
0 commit comments