Skip to content

Commit 43a4cd9

Browse files
committed
hovertemplate: do not look into trace object, use fullData instead
1 parent 61a2da7 commit 43a4cd9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/fx/hover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ function createHoverText(hoverData, opts, gd) {
974974
var hovertemplateLabels = d.hovertemplateLabels || d;
975975
var eventData = d.eventData[0] || {};
976976
if(hovertemplate) {
977-
text = Lib.hovertemplateString(hovertemplate, hovertemplateLabels, eventData, trace);
977+
text = Lib.hovertemplateString(hovertemplate, hovertemplateLabels, eventData);
978978

979979
text = text.replace(EXTRA_STRING_REGEX, function(match, extra) {
980980
name = extra; // Assign name for secondary text label

test/jasmine/tests/hover_label_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ describe('hover info', function() {
16051605

16061606
it('should support pseudo-html', function(done) {
16071607
var gd = document.getElementById('graph');
1608-
Plotly.restyle(gd, 'hovertemplate', '<b>%{y:$.2f}</b><br>%{name}<extra></extra>')
1608+
Plotly.restyle(gd, 'hovertemplate', '<b>%{y:$.2f}</b><br>%{fullData.name}<extra></extra>')
16091609
.then(function() {
16101610
Fx.hover('graph', evt, 'xy');
16111611

0 commit comments

Comments
 (0)