Skip to content

Commit 4ef8205

Browse files
committed
unified hover: remove extendFlat to handle falsy value for hoverlabel
1 parent 531fe79 commit 4ef8205

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/fx/hoverlabel_defaults.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts
1919
if(!opts.bgcolor && contIn.legend) opts.bgcolor = contIn.legend.bgcolor;
2020
if(!opts.bordercolor && contIn.legend) opts.bordercolor = contIn.legend.bordercolor;
2121
// Merge in decreasing order of importance layout.font, layout.legend.font and hoverlabel.font
22-
opts.font = Lib.extendFlat({}, contIn.font, contIn.legend ? contIn.legend.font : {}, opts.font);
22+
23+
var l = contIn.legend;
24+
if(!opts.font) opts.font = {};
25+
if(!opts.font.size) opts.font.size = l && l.size ? l.size : contIn.font.size;
26+
if(!opts.font.family) opts.font.family = l && l.family ? l.family : contIn.font.family;
27+
if(!opts.font.color) opts.font.color = l && l.color ? l.color : contIn.font.color;
2328
}
2429

2530
coerce('hoverlabel.bgcolor', opts.bgcolor);

0 commit comments

Comments
 (0)