artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

tooltip over many points

Hello again :)
I have an issue, cause I have lots of points that are at similar time (ex. one starts on 13 and ends on 15, and other starts on 14 and ends on 16) and I would like to have a tooltip that will show both points when my mouse pointer is over ex. 13:30 :)
like here: https://jsfiddle.net/0bo6rxtw/1/
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: tooltip over many points

Hi,
We appreciate you reaching out to us again :)

Highcharts doesn't have that option in the core, but it can be easily achieved using a custom tooltip.formatter

API References:
https://api.highcharts.com/gantt/tooltip.formatter

Let me know how are you going with this.
Best regards.
Sebastian Hajdus
Highcharts Developer
artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Re: tooltip over many points

I was using pointFormatter, but I see, that in formatter is the same issue. this points to main component, and not to this from documentation (this doesn't have points/percentage/series/etc. ).
Here is some example:
https://stackblitz.com/edit/highcharts- ... ntt-ws91gh
And formatter has only one argument (tooltip) that it gives :/

Yeah, i am using angular :)
artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Re: tooltip over many points

And second thing is that tooltip.formatter (just as pointFormatter) is updating only when top point is changing. If a task below is changing (if you move mouse pointer from left to right in fiddle example from first post tooltip will change every time when new point will appear below mouse pointer, but if you move from right to left tooltip will change only when you leave point which is on top)
artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Re: tooltip over many points

Ok, i managed to resolve first issue (arrow functions are evil :mrgreen: )
but second issue is still on, and ... i don't know how the "shared" option of tooltip works, cause I thought that when I use tooltip.shared in this.points i will have all points below mouse pointer, but ... i don't get it
https://jsfiddle.net/dvxzpa4t/1/
this.points.length is always 1 :/
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: tooltip over many points

Hi,
Thanks for your messages.

At that, I can see in API there no existing options shared in Gantt.
https://api.highcharts.com/gantt/tooltip.formatter

I will present to you the concept as if I were trying to do point detection.
First check how many points you have and if there are any points with overlapping dates, if so, show them these two points in tooltip.
I don't have a ready-made solution and it requires more work to make them from the finger.

If you have trouble with implementation, you can reach me any time :)
Best regards.
Sebastian Hajdus
Highcharts Developer
artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Re: tooltip over many points

sebastian.h wrote: Mon May 10, 2021 10:40 am I will present to you the concept as if I were trying to do point detection.
First check how many points you have and if there are any points with overlapping dates, if so, show them these two points in tooltip.
I don't have a ready-made solution and it requires more work to make them from the finger.
Thanks for your suggestion :)

Is there any way to update tooltip on fly? Cause as far as I recall tooltip.formatter is perform only on pointenter event.
In my application I'm gathering points number from pointermove event (on parent div), and on tooltip.formatter event I'm showing that number, but tooltip.formatter isn't update'ing when this number changes :)

like here: https://stackblitz.com/edit/highcharts- ... onent.html
When you hover over points, the pointOnMouseNumber is changing, but the same pointOnMouseNumber added to tooltip doesn't change
artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Re: tooltip over many points

I don't know if this is the best approach, but I managed:
https://stackblitz.com/edit/highcharts- ... mponent.ts
:mrgreen:
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: tooltip over many points

Hi,
Sorry for my late reply.

I'm happy that you find a solution you a clever guy!

For me, your approach looks good.
Best regards.
Sebastian Hajdus
Highcharts Developer
Shwetanana
Posts: 18
Joined: Tue May 25, 2021 1:53 pm

Tooltip on Bar stack chart

Hi,
I am trying to implement tooltip on bar stack chart using positioner. But while zooming in and zooming out, tooltip is moving to the end of the bar and hide under different component. Please suggest me how I can solve this issue.
artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Re: tooltip over many points

I think that you need to update tooltips coordinations, cause when you zoom in/out you are changing coordinations of mouse pointer inside of the chart. Or you can simply close tooltip and open it again in the zooming event :)
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: tooltip over many points

Hi Shwetanana,

I answered to your question in this topic:
viewtopic.php?f=19&t=46637&p=167325#p167355

Best regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Gantt”