Skip to content

Commit 3be88c4

Browse files
committed
consider reversed axes in ordering box hover
1 parent e189c4d commit 3be88c4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/traces/box/hover.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,14 @@ function hoverOnBoxes(pointData, xval, yval, hovermode) {
150150
(!hasFences && hasMean) ? ['max', 'q3', 'mean', 'q1', 'min'] :
151151
['max', 'q3', 'q1', 'min'];
152152

153-
if(trace.orientation === 'h') attrs.reverse();
153+
var rev = vAxis.range[1] < vAxis.range[0];
154+
155+
if(
156+
(!rev && trace.orientation === 'h') ||
157+
(rev && trace.orientation === 'v')
158+
) {
159+
attrs.reverse();
160+
}
154161

155162
// always put median at the start so that it get the extra label
156163
attrs = ['med'].concat(attrs);

0 commit comments

Comments
 (0)