Skip to content

Commit 870b2e6

Browse files
committed
use hoverlabel font for main and group titles
1 parent 2fe0490 commit 870b2e6

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

draftlogs/5895_fix.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Use hoverlabel.font for group titles and increase the size of main hover label in unified hover modes
1+
- Use hoverlabel.font for group titles in unified hover modes

src/components/fx/hover.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -1030,16 +1030,12 @@ function createHoverText(hoverData, opts, gd) {
10301030

10311031
// mock legend
10321032
var hoverlabel = fullLayout.hoverlabel;
1033+
var font = hoverlabel.font;
10331034
var mockLayoutIn = {
10341035
showlegend: true,
10351036
legend: {
1036-
title: {
1037-
text: t0,
1038-
font: Lib.extendFlat({}, hoverlabel.font, {
1039-
size: Math.round(hoverlabel.font.size * 1.2) // larger font size
1040-
})
1041-
},
1042-
font: hoverlabel.font,
1037+
title: {text: t0, font: font},
1038+
font: font,
10431039
bgcolor: hoverlabel.bgcolor,
10441040
bordercolor: hoverlabel.bordercolor,
10451041
borderwidth: 1,
@@ -1086,9 +1082,7 @@ function createHoverText(hoverData, opts, gd) {
10861082

10871083
// Draw unified hover label
10881084
mockLegend._inHover = true;
1089-
mockLegend._groupTitleFont = Lib.extendFlat({}, hoverlabel.font, {
1090-
size: Math.round(hoverlabel.font.size * 1.1) // larger font size
1091-
});
1085+
mockLegend._groupTitleFont = font;
10921086
legendDraw(gd, mockLegend);
10931087

10941088
// Position the hover

0 commit comments

Comments
 (0)