marieas
Posts: 13
Joined: Wed Sep 08, 2021 8:34 am

Add tooltip to plotline label

Hi!
Is it possible to add a tooltip to the plotline label? I know it is possible to add events to the plotLine, but how would you go forth to implement it on the label? Is it possible to add an eventListener on the label through setting useHTML to true, and do some magic here? Or is it possible to use the plotLineOrBand.render function?
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Add tooltip to plotline label

Hello marieas,

Thanks for contacting us with your question.

Something like that is not implemented, but it is possible to create tooltip like that. Basically what you need to do is to find svg element for which you want to create a tooltip and then bind mouseover and mouseout events to show and hide it. You can create it using simple div and your styles or use Highcharts SVGrenderer tool which can be used to draw simple shapes.
Here are topics where you can find examples and read about implementation: viewtopic.php?t=42016,
viewtopic.php?t=28111

Let me know if that was what you were looking for!
Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”