jfoti
Posts: 5
Joined: Sat Feb 27, 2021 8:10 pm

Display a single tooltip on top a stacked column chart regardless of the series hovered in the stack

Hi,
I am trying to get a StackColumn Chart to position tooltips over the entire stack no matter which series I roll over. I am using the formatter but am having trouble when rolling over a series other than 0, getting the coordinates to be able to position the tooltip affectively. I know I can fix the plotY value near the top but not dynamically for shortened stacked series (it ends up being too far away in many cases or overlapping when the series gets larger). Is there a way to add up the individual series heights and subtract the chart height?
current fixed pos given hover
current fixed pos given hover
current fixed y position copy.png (66.77 KiB) Viewed 1085 times
Desired dynamic position given hover
Desired dynamic position given hover
desired y position copy.png (64.33 KiB) Viewed 1085 times
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Display a single tooltip on top a stacked column chart regardless of the series hovered in the stack

Hello, welcome to the official highcharts forum, and thanks for contacting us with your question!
You can position the tooltip wherever you want, using the positioner function. Check the demo below, where I created the demo, where I position the tooltip with y = 0, and x = position of the column: https://jsfiddle.net/BlackLabel/h84n3L7y/4/

Is this what you are trying to achieve? In case of any further questions feel free to contact us again! Kind regards,
Paweł Lysy
Highcharts Developer
jfoti
Posts: 5
Joined: Sat Feb 27, 2021 8:10 pm

Re: Display a single tooltip on top a stacked column chart regardless of the series hovered in the stack

Today I have everything positioned at y=0. What I wanted to do was to find the top of the stacked column no matter which series in the column I rolled over. This way the tip will always display at the top of each column or slightly offset etc depending on the circumstances.
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Display a single tooltip on top a stacked column chart regardless of the series hovered in the stack

Hi! You can use the chart.hoverPoint values to find the y value, that you were looking for! Check the demo below: https://jsfiddle.net/BlackLabel/fbq53dct/2/

Kind regards,
Paweł Lysy
Highcharts Developer
jfoti
Posts: 5
Joined: Sat Feb 27, 2021 8:10 pm

Re: Display a single tooltip on top a stacked column chart regardless of the series hovered in the stack

Ahhhh, I would have but my hoverPoint is null. We are using Highcharts 7.2, may need to upgrade?
Screen Shot 2021-03-02 at 12.10.31 PM copy.png
Screen Shot 2021-03-02 at 12.10.31 PM copy.png (155.07 KiB) Viewed 1066 times
jfoti
Posts: 5
Joined: Sat Feb 27, 2021 8:10 pm

Re: Display a single tooltip on top a stacked column chart regardless of the series hovered in the stack

Scratch that, we are using 9.01 but I still get null for those attributes
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Display a single tooltip on top a stacked column chart regardless of the series hovered in the stack

please, share the demo, where this issue is reproduced! Kind regards,
Paweł Lysy
Highcharts Developer

Return to “Highcharts Usage”