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

[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:

Looks like you got hit by the same inconsistency as in which unfortunately we’re only planning on fixing in plotly.js v2.