@@ -573,6 +573,7 @@ export function isWithinLineBounds(
573573 chartDimensions : Dimensions ,
574574 domainType : AnnotationDomainType ,
575575 marker ?: AnnotationMarker ,
576+ hideLinesTooltips ?: boolean ,
576577) : boolean {
577578 const [ startX , startY , endX , endY ] = linePosition ;
578579 const isXDomainAnnotation = isXDomain ( domainType ) ;
@@ -584,26 +585,26 @@ export function isWithinLineBounds(
584585 const isHorizontalChartRotation = isHorizontalRotation ( chartRotation ) ;
585586 const chartWidth = chartDimensions . width ;
586587 const chartHeight = chartDimensions . height ;
587-
588- if ( isXDomainAnnotation ) {
589- isCursorWithinXBounds = isHorizontalChartRotation
590- ? cursorPosition . x >= startX - offset && cursorPosition . x <= endX + offset
591- : cursorPosition . x >= chartHeight - startX - offset && cursorPosition . x <= chartHeight - endX + offset ;
592- isCursorWithinYBounds = isHorizontalChartRotation
593- ? cursorPosition . y >= startY && cursorPosition . y <= endY
594- : cursorPosition . y >= startY - offset && cursorPosition . y <= endY + offset ;
595- } else {
596- isCursorWithinXBounds = isHorizontalChartRotation
597- ? cursorPosition . x >= startX && cursorPosition . x <= endX
598- : cursorPosition . x >= startX - offset && cursorPosition . x <= endX + offset ;
599- isCursorWithinYBounds = isHorizontalChartRotation
600- ? cursorPosition . y >= startY - offset && cursorPosition . y <= endY + offset
601- : cursorPosition . y >= chartWidth - startY - offset && cursorPosition . y <= chartWidth - endY + offset ;
602- }
603-
604- // If it's within cursor bounds, return true (no need to check marker bounds)
605- if ( isCursorWithinXBounds && isCursorWithinYBounds ) {
606- return true ;
588+ if ( ! hideLinesTooltips ) {
589+ if ( isXDomainAnnotation ) {
590+ isCursorWithinXBounds = isHorizontalChartRotation
591+ ? cursorPosition . x >= startX - offset && cursorPosition . x <= endX + offset
592+ : cursorPosition . x >= chartHeight - startX - offset && cursorPosition . x <= chartHeight - endX + offset ;
593+ isCursorWithinYBounds = isHorizontalChartRotation
594+ ? cursorPosition . y >= startY && cursorPosition . y <= endY
595+ : cursorPosition . y >= startY - offset && cursorPosition . y <= endY + offset ;
596+ } else {
597+ isCursorWithinXBounds = isHorizontalChartRotation
598+ ? cursorPosition . x >= startX && cursorPosition . x <= endX
599+ : cursorPosition . x >= startX - offset && cursorPosition . x <= endX + offset ;
600+ isCursorWithinYBounds = isHorizontalChartRotation
601+ ? cursorPosition . y >= startY - offset && cursorPosition . y <= endY + offset
602+ : cursorPosition . y >= chartWidth - startY - offset && cursorPosition . y <= chartWidth - endY + offset ;
603+ }
604+ // If it's within cursor bounds, return true (no need to check marker bounds)
605+ if ( isCursorWithinXBounds && isCursorWithinYBounds ) {
606+ return true ;
607+ }
607608 }
608609
609610 if ( ! marker ) {
@@ -748,6 +749,7 @@ export function computeLineAnnotationTooltipState(
748749 chartRotation : Rotation ,
749750 chartDimensions : Dimensions ,
750751 axesSpecs : Map < AxisId , AxisSpec > ,
752+ hideLinesTooltips ?: boolean ,
751753) : AnnotationTooltipState {
752754 const annotationTooltipState : AnnotationTooltipState = {
753755 isVisible : false ,
@@ -778,6 +780,7 @@ export function computeLineAnnotationTooltipState(
778780 chartDimensions ,
779781 domainType ,
780782 line . marker ,
783+ hideLinesTooltips ,
781784 ) ;
782785
783786 if ( isWithinBounds ) {
@@ -991,14 +994,14 @@ export function computeAnnotationTooltipState(
991994 for ( const [ annotationId , annotationDimension ] of annotationDimensions ) {
992995 const spec = annotationSpecs . get ( annotationId ) ;
993996
994- if ( ! spec ) {
997+ if ( ! spec || spec . hideTooltips ) {
995998 continue ;
996999 }
9971000
9981001 const groupId = spec . groupId ;
9991002
10001003 if ( isLineAnnotation ( spec ) ) {
1001- if ( spec . hideTooltips || spec . hideLines ) {
1004+ if ( spec . hideLines ) {
10021005 continue ;
10031006 }
10041007
@@ -1011,6 +1014,7 @@ export function computeAnnotationTooltipState(
10111014 chartRotation ,
10121015 chartDimensions ,
10131016 axesSpecs ,
1017+ spec . hideLinesTooltips ,
10141018 ) ;
10151019
10161020 if ( lineAnnotationTooltipState . isVisible ) {
0 commit comments