echarts堆叠柱状图显示总量与标题

在这里插入图片描述

代码如下:

option = {
  title: {
        text: '{a|变更请求数量} {b|26}',
        // x: 'left',
        top: 15,
        textStyle: {
    rich: {
        a: {
            fontWeight: 600,
          fontSize: 16
        },
        b: {
            color: '#0B53FD',
            fontWeight: 600,
          fontSize: 20
        },
        }
        
    }
       
    },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      // Use axis to trigger tooltip
      type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
    }
  },
  legend: {
      bottom: 0,
      left: 'center',
      itemWidth: 20,
      itemHeight: 10,
      // textStyle: {
      //     fontSize: 14,
      //     padding: [3, 0, 0, 0],
      // },
      data: ['低', '中', '高']
  },
  color: ['#0B53FD', '#799DF3', '#BDC3D0'],
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  yAxis: {
    splitLine:{
      show:true,
      lineStyle:{
          type:'dashed'
      }
    }
  },
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    axisTick: {
        show: false,
     },
    
  },
  series: [
    {
      name: '高',
      type: 'bar',
      stack: 'total',
      label: {
        show: true
      },
      data: [320, 302, 301, 334, 390, 330, 320]
    },
    {
      name: '中',
      type: 'bar',
      stack: 'total',
      label: {
        show: true
      },
      data: [120, 132, 101, 134, 90, 230, 210]
    },
    {
      name: '低',
      type: 'bar',
      stack: 'total',
      label: {
        show: true
      },
      data: [220, 182, 191, 234, 290, 330, 310]
    },
    {
        name: '总数',
        type: 'bar',
        stack: 'total',
        label: {
            normal: {
                show: true,
                position: 'insideBottom',
                formatter: '{c}',
                textStyle: {
                    color: '#000'
                }
            }
        },
        itemStyle: {
            normal: {
                color: 'rgba(128, 128, 128, 0)'
            }
        },
        data: [690, 446, 493, 522, 470, 390, 400]
    }
  ]
};
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

King's Blog

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值