diff --git a/src/chart/components/events/events-hit-test.drawer.ts b/src/chart/components/events/events-hit-test.drawer.ts index 27e7661..63ca5f9 100644 --- a/src/chart/components/events/events-hit-test.drawer.ts +++ b/src/chart/components/events/events-hit-test.drawer.ts @@ -38,6 +38,11 @@ export class EventsHitTestDrawer implements Drawer { const bounds = this.canvasBoundsContainer.getBounds(CanvasElement.EVENTS); ctx.save(); this.model.events.forEach((event, idx) => { + const visible = this.config.components.events.eventsVisibility[event.type]; + if (!visible) { + return; + } + const prevEvent = this.model.events[idx - 1]; const prevX = prevEvent && @@ -53,7 +58,8 @@ export class EventsHitTestDrawer implements Drawer { const hoverSize = (size + hoverExtendedAreaPixels) * 2; if (prevX !== undefined) { const prevSize = getEventSize(prevEvent); - const isIntersectsWithPrev = prevX + prevSize > x - hoverSize / 2; + const prevVisible = this.config.components.events.eventsVisibility[prevEvent.type]; + const isIntersectsWithPrev = prevVisible && prevX + prevSize > x - hoverSize / 2; if (isIntersectsWithPrev) { const hoverSize = size * 2 + hoverExtendedAreaPixels; ctx.fillRect(prevX + prevSize, bounds.y, hoverSize, bounds.height);