Skip to content

Commit bb97abe

Browse files
committed
add hovertemplate support in histogram
1 parent 8214d36 commit bb97abe

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/traces/histogram/attributes.js

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ module.exports = {
185185
].join(' ')
186186
},
187187

188+
hovertemplate: barAttrs.hovertemplate,
189+
188190
marker: barAttrs.marker,
189191

190192
selected: barAttrs.selected,

src/traces/histogram/defaults.js

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5656
// autobin(x|y) are only included here to appease Plotly.validate
5757
coerce('autobin' + sampleLetter);
5858

59+
coerce('hovertemplate');
60+
5961
handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout);
6062

6163
// override defaultColor for error bars with defaultLine

src/traces/histogram/hover.js

+2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
2727
pointData[posLetter + 'Label'] = hoverLabelText(pointData[posLetter + 'a'], di.ph0, di.ph1);
2828
}
2929

30+
if(trace.hovermplate) pointData.hovertemplate = trace.hovertemplate;
31+
3032
return pts;
3133
};

0 commit comments

Comments
 (0)