Skip to content

Commit d20b8e2

Browse files
authored
Merge pull request #6944 from weiweikee/dev-parcats-color-hover
Fix hover count info label in `createHoverLabelForColorHovermode`
2 parents 33b7e8c + e50cc7a commit d20b8e2

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Diff for: draftlogs/6944_change.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Fix hover count in parcats trace [[#6944](https://github.com/plotly/plotly.js/pull/6944)],
2+
with thanks to @weiweikee for the contribution!
3+

Diff for: src/traces/parcats/parcats.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ function createHoverLabelForColorHovermode(gd, rootBBox, bandElement) {
921921
var pColorGivenCat = bandColorCount / catCount;
922922

923923
var labels = {
924-
countLabel: totalCount,
924+
countLabel: bandColorCount,
925925
categoryLabel: catLabel,
926926
probabilityLabel: pColorAndCat.toFixed(3)
927927
};

Diff for: test/image/mocks/parcats_hoveron_color.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{"type": "parcats",
44
"domain": {"x": [0.125, 0.625],"y": [0.25, 0.75]},
55
"hoveron": "color",
6-
"hoverinfo": "probability",
6+
"hoverinfo": "count+probability",
77
"dimensions":[
88
{"label": "One", "values": [1, 1, 2, 1, 2, 1, 1, 2, 1]},
99
{"label": "Two", "values": ["A", "B", "A", "B", "C", "C", "A", "B", "C"]},

0 commit comments

Comments
 (0)