11import { Snapshot } from '../module/cchart.js'
2- import { Element , Marker , PointerEvent } from '../events.js'
2+ import { Element , Marker , MarkerLabel , PointerEvent } from '../events.js'
33import { Plugin , type PluginHooks , type PrepareAnimationContext } from '../plugins.js'
44
55import Vizzu from '../vizzu.js'
@@ -71,8 +71,8 @@ export class Tooltip implements Plugin {
7171 _mouseon ( param : PointerEvent ) : void {
7272 this . _id ++
7373 const id = this . _id
74- if ( param . target && this . _isMarker ( param . target ) ) {
75- const markerId = param . target . index
74+ const markerId = this . _getMarkerId ( param . target )
75+ if ( markerId !== null ) {
7676 setTimeout ( ( ) => {
7777 this . _in ( id , markerId )
7878 } , 0 )
@@ -86,6 +86,8 @@ export class Tooltip implements Plugin {
8686 _getMarkerId ( target : Element | null ) : number | null {
8787 if ( target && this . _isMarker ( target ) ) {
8888 return target . index
89+ } else if ( target && this . _isMarkerLabel ( target ) ) {
90+ return target . parent . index
8991 } else {
9092 return null
9193 }
@@ -95,6 +97,10 @@ export class Tooltip implements Plugin {
9597 return target . tagName === 'plot-marker'
9698 }
9799
100+ _isMarkerLabel ( target : Element ) : target is MarkerLabel {
101+ return target . tagName === 'plot-marker-label'
102+ }
103+
98104 _in ( id : number , markerId : number ) : void {
99105 if ( this . _id === id ) {
100106 if ( ! this . _animating ) {
0 commit comments