@@ -529,19 +529,19 @@ export default class Tooltip {
529
529
syncedCharts = this . ctx . getSyncedCharts ( )
530
530
}
531
531
532
- const isStickyTooltip =
532
+ let isStickyTooltip =
533
533
w . globals . xyCharts ||
534
534
( w . config . chart . type === 'bar' &&
535
535
! w . globals . isBarHorizontal &&
536
536
this . tooltipUtil . hasBars ( ) &&
537
537
this . tConfig . shared ) ||
538
538
( w . globals . comboCharts && this . tooltipUtil . hasBars ( ) )
539
539
540
- const isInteractionInProcess = ( e . type === 'mousemove' || e . type === 'touchmove' || e . type === 'mouseup' )
541
- const isInteractionEnd = ( e . type === 'mouseout ' || e . type === 'touchend' )
542
- const isChartContextTarget = w . globals . dom . baseEl . contains ( e . relatedTarget )
543
-
544
- if ( isInteractionInProcess ) {
540
+ if (
541
+ e . type === 'mousemove ' ||
542
+ e . type === 'touchmove' ||
543
+ e . type === 'mouseup'
544
+ ) {
545
545
// there is no series to hover over
546
546
if (
547
547
w . globals . collapsedSeries . length +
@@ -555,9 +555,10 @@ export default class Tooltip {
555
555
xcrosshairs . classList . add ( 'apexcharts-active' )
556
556
}
557
557
558
- const hasYAxisTooltip = this . yaxisTooltips . includes ( true )
559
-
560
- if ( this . ycrosshairs !== null && hasYAxisTooltip ) {
558
+ const hasYAxisTooltip = this . yaxisTooltips . filter ( ( b ) => {
559
+ return b === true
560
+ } )
561
+ if ( this . ycrosshairs !== null && hasYAxisTooltip . length ) {
561
562
this . ycrosshairs . classList . add ( 'apexcharts-active' )
562
563
}
563
564
@@ -567,10 +568,10 @@ export default class Tooltip {
567
568
) {
568
569
this . handleStickyTooltip ( e , clientX , clientY , opt )
569
570
} else {
570
- const isHeatmap = w . config . chart . type === 'heatmap'
571
- const isTreemap = w . config . chart . type === 'treemap'
572
-
573
- if ( isHeatmap || isTreemap ) {
571
+ if (
572
+ w . config . chart . type === 'heatmap' ||
573
+ w . config . chart . type === 'treemap'
574
+ ) {
574
575
let markerXY = this . intersect . handleHeatTreeTooltip ( {
575
576
e,
576
577
opt,
@@ -581,8 +582,8 @@ export default class Tooltip {
581
582
x = markerXY . x
582
583
y = markerXY . y
583
584
584
- tooltipEl . style . left = ` ${ x } px`
585
- tooltipEl . style . top = ` ${ y } px`
585
+ tooltipEl . style . left = x + 'px'
586
+ tooltipEl . style . top = y + 'px'
586
587
} else {
587
588
if ( this . tooltipUtil . hasBars ( ) ) {
588
589
this . intersect . handleBarTooltip ( {
@@ -611,7 +612,7 @@ export default class Tooltip {
611
612
612
613
w . globals . dom . baseEl . classList . add ( 'apexcharts-tooltip-active' )
613
614
opt . tooltipEl . classList . add ( 'apexcharts-active' )
614
- } else if ( ! isChartContextTarget && isInteractionEnd ) {
615
+ } else if ( e . type === 'mouseout' || e . type === 'touchend' ) {
615
616
this . handleMouseOut ( opt )
616
617
}
617
618
}
0 commit comments