@@ -131,21 +131,10 @@ exports.loneHover = function loneHover(hoverItems, opts) {
131131 var gLeft = getLeftOffset ( gd ) ;
132132
133133 var pointsData = hoverItems . map ( function ( hoverItem ) {
134- var _x0 = 0 ;
135- if ( hoverItem . x0 !== undefined ) _x0 = hoverItem . x0 ;
136- else if ( hoverItem . x !== undefined ) _x0 = hoverItem . x ;
137-
138- var _x1 = 0 ;
139- if ( hoverItem . x1 !== undefined ) _x1 = hoverItem . x1 ;
140- else if ( hoverItem . x !== undefined ) _x1 = hoverItem . x ;
141-
142- var _y0 = 0 ;
143- if ( hoverItem . y0 !== undefined ) _y0 = hoverItem . y0 ;
144- else if ( hoverItem . y !== undefined ) _y0 = hoverItem . y ;
145-
146- var _y1 = 0 ;
147- if ( hoverItem . y1 !== undefined ) _y1 = hoverItem . y1 ;
148- else if ( hoverItem . y !== undefined ) _y1 = hoverItem . y ;
134+ var _x0 = hoverItem . _x0 || hoverItem . x0 || hoverItem . x || 0 ;
135+ var _x1 = hoverItem . _x1 || hoverItem . x1 || hoverItem . x || 0 ;
136+ var _y0 = hoverItem . _y0 || hoverItem . y0 || hoverItem . y || 0 ;
137+ var _y1 = hoverItem . _y1 || hoverItem . y1 || hoverItem . y || 0 ;
149138
150139 var eventData = hoverItem . eventData ;
151140 if ( eventData ) {
@@ -181,10 +170,10 @@ exports.loneHover = function loneHover(hoverItems, opts) {
181170
182171 return {
183172 color : hoverItem . color || Color . defaultLine ,
184- x0 : _x0 ,
185- x1 : _x1 ,
186- y0 : _y0 ,
187- y1 : _y1 ,
173+ x0 : hoverItem . x0 || hoverItem . x || 0 ,
174+ x1 : hoverItem . x1 || hoverItem . x || 0 ,
175+ y0 : hoverItem . y0 || hoverItem . y || 0 ,
176+ y1 : hoverItem . y1 || hoverItem . y || 0 ,
188177 xLabel : hoverItem . xLabel ,
189178 yLabel : hoverItem . yLabel ,
190179 zLabel : hoverItem . zLabel ,
0 commit comments