想了零时解决办法
添加辅助条  
1、辅助条的数字和 yMin 值一样
2、对应的data 的 value值也要相应的减去 ymin 的值

app.title = '堆叠柱状图';
option = {
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器,坐标轴触发有效
            type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
        }
    },
    legend: {
        data: ["汽温", "壁温", "氧化", "超温"],
        bottom: 1
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : ["1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7"]
        }
    ],
    yAxis : [
        {
            min: function(){return 450},
            max: function(){return 500},
            type : 'value'
        }
    ],
    series : [
        {
            name: '辅助',
            type: 'bar',
            stack: '广告',
            itemStyle: {
                normal: {
                    barBorderColor: 'rgba(0,0,0,0)',
                    color: 'rgba(0,0,0,0)'
                },
                emphasis: {
                    barBorderColor: 'rgba(0,0,0,0)',
                    color: 'rgba(0,0,0,0)'
                }
            },
            data: [450, 450, 450, 450, 450, 450, 450]
        },
        {
            name:'应收',
            type:'bar',
            data:[450, 450, 453, 450, 450, 450, 450]
        },
        {
            name:'电视',
            type:'bar',
            stack: '广告',
            data:[10, 20, 30, "-", "-", 40, "-"]
        },
        {
            name:'手机',
            type:'bar',
            stack: '广告',
            data:["-", "-", "-", "-", 50, "-", "-"]
        },
        {
            name:'网页',
            type:'bar',
            stack: '广告',
            data:["-", "-", "-", 0, "-", "-", 0]
        }
    ]
};


[ Full content available at: 
https://github.com/apache/incubator-echarts/issues/6938 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to