How to get the first and the last poin values in ECHARTS of the visible zone on the screen when it’s initialized and on resize

I’m trying to get back the first and the last value in ECHARTS on a graph like this

where there’s also a zoomable zone

I’ve tryied

<script>
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);

function test(){
    console.log(myChart.getOption());
}
test();
</script>

that gives back the series object after initialization.

So you can get back the first and last coords like this

    first_serie_coords = myChart.getOption().series[0].coords;
    first_element = first_serie_coords[0]
    last_element = first_serie_coords[first_serie_coords.length - 1]
    
    //console.log(chart.getOption());
    console.log(first_element, last_element)

But how to get also the start end the end point when the graph zooming zone it’s resized?