Page 1 of 1

how to handle tooltip refresh event?

Posted: Fri May 24, 2019 10:17 pm
by ying
Hi,

From your source code the tooltip will fire a refresh event every time it refresh its content and position. However from my test, looks like it is not fired. Is there any thing wrong with my code?

http://jsfiddle.net/6jyL3rxh/

Re: how to handle tooltip refresh event?

Posted: Mon May 27, 2019 7:03 am
by rafalS
Hi ying,

In docs, there is no something like tooltip.events.refresh. If you want to fire a function every time the tooltip is shown, I suggest using point.events.mouseOver event: https://api.highcharts.com/highstock/pl ... .mouseOver

If it doesn't meet your requirements, please provide me more details about what do you want to do, and I will suggest another approach.

Best regards!

Re: how to handle tooltip refresh event?

Posted: Mon May 27, 2019 4:05 pm
by ying
Hi, Thanks for your reply

but from the source code of highstock.src.js, H.Tooltip do fire an event when do refresh. I'm using version 7.1.1

Re: how to handle tooltip refresh event?

Posted: Tue May 28, 2019 12:56 pm
by bastss
Hello ying,

You can handle tooltip refresh event via working on Tooltip.prototype. Check below demo:
https://jsfiddle.net/BlackLabel/tkdrohe7/

Kind regards!

Re: how to handle tooltip refresh event?

Posted: Tue May 28, 2019 5:55 pm
by ying
you basically copy paste the original refresh function of H.Tooltip in highcharts.src.js. just curious why the one in the highchart.js is not working with the fired event,(why can not catch the event?) but have to define the refresh function again with customized handling -- your alert message

Re: how to handle tooltip refresh event?

Posted: Thu May 30, 2019 3:35 pm
by bastss
ying,

As Rafal wrote:
In docs, there is no something like tooltip.events.refresh.
Inside tooltip object, you can set options which should be triggered from the core. Notice that tooltip.events it's not defined in the core. I showed you a way how to 'get inside' the core to do some changes.

Here is a demo which should help you to understand what I am talking about - look into developer console after hovering some point:
https://jsfiddle.net/Bastsss/6hpoq0r4/

Kind regards!

Re: how to handle tooltip refresh event?

Posted: Thu Jun 08, 2023 10:05 pm
by ow2code
just fyi there is a comment missing in the highcharts.chart method, right before series (wont work otherwise)