ying
Posts: 29
Joined: Mon Nov 06, 2017 11:08 pm

how to handle tooltip refresh event?

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/
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: how to handle tooltip refresh event?

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!
Rafal Sebestjanski,
Highcharts Team Lead
ying
Posts: 29
Joined: Mon Nov 06, 2017 11:08 pm

Re: how to handle tooltip refresh event?

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
Attachments
Capture.PNG
Capture.PNG (188.62 KiB) Viewed 6316 times
bastss
Site Admin
Posts: 1200
Joined: Wed Oct 17, 2018 10:59 am

Re: how to handle tooltip refresh event?

Hello ying,

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

Kind regards!
Sebastian Wędzel,
Highcharts Developer
ying
Posts: 29
Joined: Mon Nov 06, 2017 11:08 pm

Re: how to handle tooltip refresh event?

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
bastss
Site Admin
Posts: 1200
Joined: Wed Oct 17, 2018 10:59 am

Re: how to handle tooltip refresh event?

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!
Sebastian Wędzel,
Highcharts Developer
ow2code
Posts: 14
Joined: Fri Jan 06, 2023 1:44 pm

Re: how to handle tooltip refresh event?

just fyi there is a comment missing in the highcharts.chart method, right before series (wont work otherwise)

Return to “Highcharts Stock”