[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
        });
    }
2 Likes

It works !

Thank you so much !

Have a good day :wink: