File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1326,22 +1326,26 @@ function createHoverText(hoverData, opts) {
1326
1326
stroke : contrastColor
1327
1327
} ) ;
1328
1328
1329
- var tbb = getBoundingClientRect ( gd , tx . node ( ) ) ;
1330
1329
var htx = d . xa . _offset + ( d . x0 + d . x1 ) / 2 ;
1331
1330
var hty = d . ya . _offset + ( d . y0 + d . y1 ) / 2 ;
1332
1331
var dx = Math . abs ( d . x1 - d . x0 ) ;
1333
1332
var dy = Math . abs ( d . y1 - d . y0 ) ;
1334
- var txTotalWidth = tbb . width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width ;
1335
- var anchorStartOK , anchorEndOK ;
1336
1333
1337
- d . ty0 = outerTop - tbb . top ;
1338
- d . bx = tbb . width + 2 * HOVERTEXTPAD ;
1339
- d . by = Math . max ( tbb . height + 2 * HOVERTEXTPAD , tx2height ) ;
1334
+ var tbb = getBoundingClientRect ( gd , tx . node ( ) ) ;
1335
+ var tbbWidth = tbb . width / fullLayout . _invScaleX ;
1336
+ var tbbHeight = tbb . height / fullLayout . _invScaleY ;
1337
+
1338
+ d . ty0 = ( outerTop - tbb . top ) / fullLayout . _invScaleY ;
1339
+ d . bx = tbbWidth + 2 * HOVERTEXTPAD ;
1340
+ d . by = Math . max ( tbbHeight + 2 * HOVERTEXTPAD , tx2height ) ;
1340
1341
d . anchor = 'start' ;
1341
- d . txwidth = tbb . width ;
1342
+ d . txwidth = tbbWidth ;
1342
1343
d . tx2width = tx2width ;
1343
1344
d . offset = 0 ;
1344
1345
1346
+ var txTotalWidth = ( tbbWidth + HOVERARROWSIZE + HOVERTEXTPAD + tx2width ) * fullLayout . _invScaleX ;
1347
+ var anchorStartOK , anchorEndOK ;
1348
+
1345
1349
if ( rotateLabels ) {
1346
1350
d . pos = htx ;
1347
1351
anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight ;
You can’t perform that action at this time.
0 commit comments