Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

[Solved] How to progamatically autoscale plot

Hi everyone, :slight_smile:

I’m having trouble finding a javascript function in the API that will autoscale my plot just like the ‘Autoscale’ button at the bottom of the chart.

Any ideas ? :confused:

Thanks in advance.

 autorangeChart() {
        Plotly.relayout('plotly', {
            'xaxis.autorange': true,
            'yaxis.autorange': true
        });
    }
3 Likes

It works !

Thank you so much !

Have a good day :wink: