'Apache ECharts Data Zooming

This is how my chart is currently

I want to zoom in such that the picture fits correctly. I dont want to display values till 0, but maybe till 18000 on Y Axis so chart can be seen well.

Pls help.

option = {
            "toolbox": {
                        "feature": {
                        "dataZoom": {
                            "yAxisIndex": "true"
                        },
                        "brush": {
                            "type": ['lineX', 'clear']
                        }
                        }
                    },
            "xAxis": {
                "data": datelist
            },
            "yAxis": {},
            "series": [
                {
                "type": 'candlestick',
                "data": ohlclist
                }
            ]
            }
return(option)


Solution 1:[1]

The scale can be set automatically, by setting the scale option from yAxis to true:

yAxis: {
  scale: true,
},

Sometimes autoscale won't behave exactly as you want, so you can set the scale manually using the min and max options from yAxis :

yAxis: {
  min: 15000,
  max: 20000
},

Note: The scale option won't work if min and max are set

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1