[SOLVED] How to get the the start and the end values of xaxis from the rangeslider

I’m still new to plotly.js and I have been trying to get the start and the end values of xaxis of the rangeslider. So far, I manage to get the values of xaxis by using :

myDiv.on('plotly_relayout',function(eventdata){ x_start = eventdata['xaxis.range[0]']; x_end = eventdata['xaxis.range[1]']; console.log(x_start+"---"+x_end); });

But when I move the rangeslider the values become NaN. I really appreciated any help.

That sounds like a bug on our part.

Would you mind sharing a reproducible example to help us debug?

Thanks for responding. So here, I made some example :

Thanks again

Ah, here’s how to make it work: https://codepen.io/etpinard/pen/GdLLwd?editors=0011

Looks like you got hit by the same inconsistency as in https://github.com/plotly/plotly.js/issues/1877 which unfortunately we’re only planning on fixing in plotly.js v2.