echarts 堆叠都从底部开始计算

效果图
在这里插入图片描述
option的值

var colors = ['#5793f3', '#d14a61', '#675bba'];

option = {
    color: colors,

    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'cross'
        }
    },
    grid: {
        right: '20%'
    },
  
    xAxis: 
        {
            type: 'category',
            axisTick: {
                alignWithLabel:true
            },
            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月']
        }
    ,
    yAxis: [
        {
            type: 'value',
            position: 'left',
            min:0,
            axisLine: {
                show: false
            },
            axisLabel: {
                formatter: '{value}'
            },
            axisTick: {
                show: false
            },
            splitArea: {show: false}
        }
    ],
    series: [
        {
            name: '蒸发量',
            type: 'bar',
            barMaxWidth:"20",
            barGap: "-100%",
            itemStyle:{
              color:"#2C9DFF",
              barBorderRadius:[0,0,10,10]
            },
            label:{
              show:true,
              position:"insideTop"
            },
            z:10,
            data: [99,150,100,20,20,10,15,23,30,60]
        },
        {
            name: '总数',
            type: 'bar',
            barMaxWidth:"20",
            itemStyle:{
             barBorderRadius:[10,10,0,0],
             color:"#E7E7E7",
            },
            label:{
              show:true,
              position:"top",
              color:"#000"
            },
            data: [100,200,500,100,100,150,600,150,130,175]
        },
       
    ]
};

重点属性

 barGap: "-100%",
 z:10,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值