Skip to content

Commit ec6c1b1

Browse files
committed
add handler for 'nameOverride' field in pointData
- similar to 'extraText', to allow trace modules' hoverPoints methods to override the 'name' hover label content.
1 parent bdbb3d6 commit ec6c1b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/plots/cartesian/graph_interact.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,8 @@ function createHoverText(hoverData, opts) {
974974
contrastColor = tinycolor(traceColor).getBrightness() > 128 ?
975975
'#000' : Color.background;
976976

977+
// to get custom 'name' labels pass cleanPoint
978+
if(d.nameOverride !== undefined) d.name = d.nameOverride;
977979

978980
if(d.name && d.zLabelVal === undefined) {
979981
// strip out our pseudo-html elements from d.name (if it exists at all)

0 commit comments

Comments
 (0)