Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c5bdee9

Browse files
authoredFeb 15, 2019
Merge pull request #3530 from plotly/hovertemplate-more
More hovertemplates!
2 parents 4eaad9b + 2d57601 commit c5bdee9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+454
-94
lines changed
 

‎src/components/fx/hover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ function createHoverText(hoverData, opts, gd) {
945945
text = d[(hovermode === 'x' ? 'y' : 'x') + 'Label'] || '';
946946
}
947947
else if(d.xLabel === undefined) {
948-
if(d.yLabel !== undefined) text = d.yLabel;
948+
if(d.yLabel !== undefined && d.trace.type !== 'scattercarpet') text = d.yLabel;
949949
}
950950
else if(d.yLabel === undefined) text = d.xLabel;
951951
else text = '(' + d.xLabel + ', ' + d.yLabel + ')';

‎src/components/fx/hovertemplate_attributes.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ module.exports = function(opts, extra) {
3131
valType: 'string',
3232
role: 'info',
3333
dflt: '',
34-
arrayOk: true,
35-
editType: 'none',
34+
editType: opts.editType || 'none',
3635
description: [
3736
'Template string used for rendering the information that appear on hover box.',
3837
'Note that this will override `hoverinfo`.',
@@ -46,5 +45,9 @@ module.exports = function(opts, extra) {
4645
].join(' ')
4746
};
4847

48+
if(opts.arrayOk !== false) {
49+
hovertemplate.arrayOk = true;
50+
}
51+
4952
return hovertemplate;
5053
};

0 commit comments

Comments
 (0)
Please sign in to comment.