ZDU
Posts: 5
Joined: Thu Jul 07, 2022 11:05 pm

Line being drawn from point to the tooltip

I have the tooltip appearing in the top left of the chart, and I noticed there is a line being drawn from the point to the tooltip. Is there a way to hide this line?

In the image, you can faintly see the black line crossing the candlesticks and going to the top location of the tooltip.

https://imgur.com/a/zYZeUub
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Line being drawn from point to the tooltip

Hello ZDU!
Welcome to our forum and thanks for contacting us with your question!

By default tooltip's shape is set to a callout with a line pointing to the point. You can change the tooltip's shape to, e.g. rectangle - which does not have any connector. Also in Highstock, you have to set tooltip.split to false. You can check the working demo below.

Code: Select all

tooltip: {
    positioner: function() {
      return {
        x: 80,
        y: 50
      };
    },
    split: false,
    shape: 'rect',
  },
Demo: https://jsfiddle.net/BlackLabel/4kgn8spx/

Feel free if you have any further questions.
Kind regards!
Hubert Kozik
Highcharts Developer
ZDU
Posts: 5
Joined: Thu Jul 07, 2022 11:05 pm

Re: Line being drawn from point to the tooltip

Thank you, Hubert! That solved the problem with the line being drawn to the tooltip. However, it seems to have disabled the crosshair label that I had for that y-axis
Last edited by ZDU on Fri Jul 08, 2022 10:43 am, edited 1 time in total.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Line being drawn from point to the tooltip

You're welcome! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer
ZDU
Posts: 5
Joined: Thu Jul 07, 2022 11:05 pm

Re: Line being drawn from point to the tooltip

hubert.k wrote: Fri Jul 08, 2022 10:39 am You're welcome! In case of any further questions, feel free to contact us again.
Sorry, I just noticed that while it solved the problem with the line being drawn to the tooltip. However, it seems to have disabled the crosshair label that I had for that y-axis

Removing the "split: false" line seems to let the crosshair label back in. Is there any particular reason why split must be false?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Line being drawn from point to the tooltip

ZDU,
You made this topic in Highcharts Stock folder, so I assumed, that you need a solution for Highstock. As you can see in this demo: https://jsfiddle.net/BlackLabel/d7rucpq8/ when split is commented out there is still a visible black line from point to the tooltip, setting split is disabling it. If your project works without split it's great :)
Hubert Kozik
Highcharts Developer
ZDU
Posts: 5
Joined: Thu Jul 07, 2022 11:05 pm

Re: Line being drawn from point to the tooltip

hubert.k wrote: Fri Jul 08, 2022 10:51 am ZDU,
You made this topic in Highcharts Stock folder, so I assumed, that you need a solution for Highstock. As you can see in this demo: https://jsfiddle.net/BlackLabel/d7rucpq8/ when split is commented out there is still a visible black line from point to the tooltip, setting split is disabling it. If your project works without split it's great :)
We're definitely using Highstock. That's interesting. I wonder if it has something to do with our custom pointFormatter method?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Line being drawn from point to the tooltip

ZDU, yes, that's very possible, that formatter is overriding some effect. Anyway, if you are happy with your results that's great :)
Hubert Kozik
Highcharts Developer
ZDU
Posts: 5
Joined: Thu Jul 07, 2022 11:05 pm

Re: Line being drawn from point to the tooltip

hubert.k wrote: Fri Jul 08, 2022 11:49 am ZDU, yes, that's very possible, that formatter is overriding some effect. Anyway, if you are happy with your results that's great :)
Switching to highcharts has made us very happy. :D
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Line being drawn from point to the tooltip

We're really glad to hear, that you are enjoying working with our charting library! If you have any questions now or in the future me or my colleague will answer you as it will be possible :)
Hubert Kozik
Highcharts Developer

Return to “Highcharts Stock”