设置X轴在Y轴刻度起始值echarts 柱状配置项内容和展示

配置项如下
      

var xAxisData = [1,2,3,4,5,6,7];
var data2 = [5,-2,-3,-10,-5,-6,-1];
var MAX = 10;

option = {
    legend: {
        data: ['bar2'],
        align: 'left'
    },
    xAxis: {
        data: xAxisData,
        type :"category",
        position:"top",
        boundaryGap:true
    },
    yAxis: {
        interval:1,
        type:'value',
        axisLabel: {
            formatter: function (value) { 
                return value + MAX;
            }
        }
    },
    series: [{
        name: 'bar2',
        type: 'bar',
        data: data2.map(function (val) {
            return val - MAX;
        }),
        label: {
            normal: {
                show: true,
                formatter: function (params) {
                    return params.value + MAX;
                }
            }
        }
    }]
};


    
截图如下