Black Lives Matter. Please consider donating to Black Girls Code today.

On click get x axis value on an empty graph

Is it possible to get exact x value on click on an empty graph? please some one help me!!!

There’s no native and no easy way way to do this at the moment.

Here’s a hacky solution: but use it at your own risk.

1 Like

Hello Etienne,
Thanks for the reply!!!
out put of your code PEN gives UNDEFINED values please check!!

I am sorry !! it is working !!
This is exactly what i am looking for!!thanks for the help

Here’s another Hacky solution, but reliable coordinates even if you zoom/pan:
*This is in the ‘scattergl’ plot