Skip to content

Commit 64561e7

Browse files
committed
hover text OK
1 parent d57f5f0 commit 64561e7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/plots/cartesian/axes.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,8 +1826,17 @@ function formatMultiCategory(ax, out, hover) {
18261826

18271827
if(hover) {
18281828
// TODO is this what we want?
1829-
// out.text = tt2 + ' - ' + tt;
1830-
out.text = texts.at(-1) + ' - ' + texts.at(-2);
1829+
var hoverText = '';
1830+
cats.forEach(function(text, index) {
1831+
text = String(text);
1832+
if(index < texts.length) {
1833+
hoverText = hoverText + ' ' + text + ' - ';
1834+
} else {
1835+
return hoverText + ' ' + text;
1836+
}
1837+
});
1838+
1839+
out.text = hoverText;
18311840
} else {
18321841
// setup for secondary labels
18331842
out.text = texts[0];

0 commit comments

Comments
 (0)