rkarimi
Posts: 17
Joined: Tue Mar 17, 2020 3:18 pm

How to get the exact point where user clicks on a plotband

Hi. I want to know the exact point where user clicks on a plotbands. Take a look at the samle code below;

https://jsfiddle.net/reza_karimi76/7nzr9Ld0/3/

The event is a simple mouse event which I can get e.clientX or e.clientY but they are not related to the axes.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: How to get the exact point where user clicks on a plotband

Hello rkarimi!

We appreciate you reaching out to us!

What do you mean that these values are not related to the axes? If you want to translate these values to values in terms of axis units you can use toValue method.

API references:
https://api.highcharts.com/class-refere ... is#toValue

Demo:
https://jsfiddle.net/BlackLabel/7L6rhc42/

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Usage”