evoker
Posts: 40
Joined: Tue Dec 01, 2020 1:01 pm

Area chart tooltip/hover works only in the middle/highest point of the chart

Greetings!

I have an area chart with one series.

I used to run Highcharts 7 but since upgrading to 10, the tooltip for all the points but the middle one stopped working. I imported as an experiment the example on Highcharts and only the highest point of the USSR/Russia point (as shown below) can be hovered.

Image

When I hover around the chart, sometimes that point gets selected.

I can try to provide a fiddlejs but I am not sure if it would help since i just copied over the example into my app.

Just to mention, I'm also using highcharts-angular.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Area chart tooltip/hover works only in the middle/highest point of the chart

Hi evoker!
We appreciate you reaching out to us!

I was trying to reproduce your problem, but in my case, everything is working correctly. You can check the demo in Angular here: https://stackblitz.com/edit/highcharts- ... ine-lp5hxm Could you reproduce the issue in an online editor that I could work on?

I am looking for your response.
Regards!
Hubert Kozik
Highcharts Developer
evoker
Posts: 40
Joined: Tue Dec 01, 2020 1:01 pm

Re: Area chart tooltip/hover works only in the middle/highest point of the chart

Hey Hubert!

Thanks for the reply. It seems the problem was from my side and more specifically an extension I did for

H.Pointer.prototype.getChartPosition

More specifically:

Code: Select all

export default Highcharts => {
  const H = Highcharts;
  const offset = H.offset;

  H.Pointer.prototype.getChartPosition = function () {
    return ( /* this.chartPosition || */
      (this.chartPosition = offset(this.chart.container)));
  };
};

The problem before updating from 7 to 10 was that if a point in the area chart was hovered (tooltip showing) and you moved the focus outside the browser window and then back into the window and hovered a new point in the chart, there was a strange offset where although you hovered say the 10th point of the area chart, the tooltip of the 2nd point was shown.

This wrapper dealt with that issue.

Would you be able to suggest a fix for this wrapper or how to combat this offset issue?

Thanks again!
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Area chart tooltip/hover works only in the middle/highest point of the chart

Hi again evoker!
I was trying to reproduce your problem, but in my case, everything is working correctly. I cannot guess what could be an issue and without reproducing the problem in some online editor I am unable to help you. Could you reproduce the issue with hover and offset in an online editor that I could work on?

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”