sebastians
Posts: 2
Joined: Wed Jan 26, 2022 11:46 am

Highcharts: Crosshair over several x-axes: Only one crosshair is displayed

Hello,

I have a highchart with two x-axes and two y-axes in order to display "two charts" in one highchart.

This works great so far, but the crosshair is only ever displayed in one chart. I have tried all the variants for creating a crosshair, but without success.

In the following example, the crosshair is only displayed in the lower chart.

http://jsfiddle.net/hrqfv9ct/8/

I would be very grateful for help on how to display the crosshair on both charts.

BR Sebastian
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Highcharts: Crosshair over several x-axes: Only one crosshair is displayed

Hello Sebastian,

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

Firstly tooltip.crosshairs property is deprecated, has been moved to the Axis object. https://api.highcharts.com/highcharts/t ... crosshairs

Crosshair doesn't show up because you haven't assigned the series with the x-axis. You should do the same as you did with the y-axis.

Demo: http://jsfiddle.net/BlackLabel/y9hp42bu/
API: https://api.highcharts.com/highcharts/series.line.xAxis

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
sebastians
Posts: 2
Joined: Wed Jan 26, 2022 11:46 am

Re: Highcharts: Crosshair over several x-axes: Only one crosshair is displayed

Hey michal.f,

works perfectly!

Thank you very much.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Highcharts: Crosshair over several x-axes: Only one crosshair is displayed

You're welcome!

In case of any further questions, feel free to contact us again.
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Usage”