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

How do I get current y-axis co ordinates


In the above fiddle, current y-axis co ordinates are [10000, 30000]. If I move the chart selected co ordinates are showing [20000, 40000].
I need to get those coordinates. How it is?. Pl help me how to do?


1 Like

Hi @lavanya,

I’ve posted exactly the same question. Would be nice if we could all vote up that posting to get some official answer. I’m not sure whether the way I calculated it there is the right one. Doesn’t look to me like that as the axis offset is prefixed with an underscore and thus was intended to use only as a private property, so it looks ugly and weird to me and I also wondered whether there is no “plotly way” of getting those coordinates.


		var target =;
		var yaixsrange=target.yaxis.range;
		var min = Math.round(yaixsrange[0]);
		var max = Math.round(yaixsrange[1]);

working fine.

I know this is probably old now, but due to my “Dash”-esque program, I had to deal with this too. I solved this similarly to @lavanya

    // Isolate your plot
    var refplot = document.getElementById('informativeId');
    // Capture the event emission 
    refplot.on('plotly_relayout', function(eventdata){
        // x-axis and y-axis ranges are attrs of the eventdata
        var xAxis = eventdata.xaxis;
        var yAxis = eventdata.yaxis;
        console.log('X-axis range: ' + xAxis);
        console.log('Y-axis range: ' + yAxis);