@@ -839,7 +839,6 @@ function createHoverText(hoverData, opts, gd) {
839
839
840
840
// show all the individual labels
841
841
842
-
843
842
// first create the objects
844
843
var hoverLabels = container . selectAll ( 'g.hovertext' )
845
844
. data ( hoverData , function ( d ) {
@@ -1055,7 +1054,7 @@ function createHoverText(hoverData, opts, gd) {
1055
1054
// know what happens if the group spans all the way from one edge to
1056
1055
// the other, though it hardly matters - there's just too much
1057
1056
// information then.
1058
- function hoverAvoidOverlaps ( hoverLabels , ax , fullLayout ) {
1057
+ function hoverAvoidOverlaps ( hoverLabels , axKey , fullLayout ) {
1059
1058
var nummoves = 0 ;
1060
1059
var axSign = 1 ;
1061
1060
var nLabels = hoverLabels . size ( ) ;
@@ -1064,10 +1063,13 @@ function hoverAvoidOverlaps(hoverLabels, ax, fullLayout) {
1064
1063
var pointgroups = new Array ( nLabels ) ;
1065
1064
1066
1065
hoverLabels . each ( function ( d , i ) {
1067
- var axis = d [ ax ] ;
1068
- var axIsX = axis . _id . charAt ( 0 ) === 'x' ;
1069
- var rng = axis . range ;
1070
- if ( ! i && rng && ( ( rng [ 0 ] > rng [ 1 ] ) !== axIsX ) ) axSign = - 1 ;
1066
+ var ax = d [ axKey ] ;
1067
+ var axIsX = ax . _id . charAt ( 0 ) === 'x' ;
1068
+ var rng = ax . range ;
1069
+
1070
+ if ( ! i && rng && ( ( rng [ 0 ] > rng [ 1 ] ) !== axIsX ) ) {
1071
+ axSign = - 1 ;
1072
+ }
1071
1073
pointgroups [ i ] = [ {
1072
1074
datum : d ,
1073
1075
i : i ,
0 commit comments