File tree 1 file changed +4
-3
lines changed
packages/vchart/src/plugin/components/tooltip-handler
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -395,9 +395,10 @@ export abstract class BaseTooltipHandler extends BasePlugin implements ITooltipH
395
395
396
396
/* 三、确保tooltip在视区内 */
397
397
const containerDimSize = dim === 'x' ? containerSize . width : containerSize . height ;
398
- const leftOrTop =
399
- - ( tooltipParentElementRect [ dim ] - ( chartElementRect ?. [ dim ] ?? 0 ) / chartElementScale ) /
400
- tooltipParentElementScale ;
398
+ const leftOrTop = tooltipSpec . confine
399
+ ? - ( tooltipParentElementRect [ dim ] - ( chartElementRect ?. [ dim ] ?? 0 ) / chartElementScale ) /
400
+ tooltipParentElementScale
401
+ : - tooltipParentElementRect [ dim ] / tooltipParentElementScale ;
401
402
const rightOrBottom = containerDimSize / tooltipParentElementScale + leftOrTop - boxSize ;
402
403
403
404
// 处理左右
You can’t perform that action at this time.
0 commit comments