不规则叠加柱状图

在这里插入图片描述

  RightTwoApply(temp) {
      var myChartRightTwo = this.$echarts.init(
        document.getElementById("rightTwos")
      );
      this.optionRightTwo = {
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        legend: {
          top: "0",
          icon: "circle",
          // orient: "vertical",
          itemHeight: 8,
          itemWidth: 8,
          textStyle: {
            color: "#000",
            fontSize: "14",
          },
        },
        grid: {
          top: '40%',
          left: '5%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        // xAxis: [
        //   {
        //     type: 'category',
        //     data: ['']
        //   }
        // ],
        // yAxis: [
        //   {
        //     type: 'value'
        //   }
        // ],
        xAxis: {
        //  只想到通过空格来确保 一条数据四个x轴属性
          data: ['  总数     审核通过数    推送数     闭环数'],
          axisLine: {
            show: true, //隐藏X轴轴线
            lineStyle: {
              color: "#ebeef5",
            },
          },
          axisTick: {
            show: false, //隐藏X轴刻度
          },
          axisLabel: {
            interval: 0,
            show: true,
            color: "#666", //X轴文字颜色
            textStyle: {
              fontSize: "14",
            },
          },
        },
        yAxis: [
          {
            type: "value",
            name: "辆",
            nameTextStyle: {
              color: "#000",
              fontSize: "14",
            },
            splitLine: {
              show: false,
            },
            axisTick: {
              show: false,
            },
            axisLine: {
              show: true,
              lineStyle: {
                color: "#ebeef5",
                fontSize: "14",
              },
            },
            axisLabel: {
              show: true,
              color: "#666",
              textStyle: {
                fontSize: "14",
              },
            },
          },
        ],
        series: [
        // 通过加不同宽度的空白柱状图来控制柱子间的距离
          {
            name: '',
            type: 'bar',
            stack: '',
            barWidth: 20,
            emphasis: {
              focus: 'series'
            },
            data: []
          },
          {
            name: '审核通过数',
            type: 'bar',
            stack: 'A',
            barWidth: 15,
            emphasis: {
              focus: 'series'
            },
            lineStyle: {
              color: "#f56b6d",
            },
            itemStyle: {
              color: "#f56b6d",
              // normal: {
              //   borderColor:'#fff', //柱子间间隙
              //   borderTopWidth: 2,
              //   // barBorderRadius:[0, 0, 5, 5]
              // }
            },
            data: [320]
          },
          {
            name: '审核不通过数',
            type: 'bar',
            stack: 'A',
            barWidth: 15,
            emphasis: {
              focus: 'series'
            },
            lineStyle: {
              color: "#ff8e43",
            },
            itemStyle: {
              color: "#ff8e43",
            },
            data: [320]
          },
          {
            name: '',
            type: 'bar',
            stack: '',
            barWidth: 40,
            emphasis: {
              focus: 'series'
            },
            data: []
          },
          {
            name: '闭环数',
            type: 'bar',
            stack: 'B',
            barWidth: 15,
            emphasis: {
              focus: 'series'
            },
            lineStyle: {
              color: "#219cf9",
            },
            itemStyle: {
              color: "#219cf9",
            },
            data: [120]
          },
          {
            name: '未闭环数',
            type: 'bar',
            stack: 'B',
            barWidth: 15,
            emphasis: {
              focus: 'series'
            },
            lineStyle: {
              color: "#40c057",
            },
            itemStyle: {
              color: "#40c057",
            },
            data: [220]
          },
          {
            name: '',
            type: 'bar',
            stack: '',
            barWidth: 40,
            emphasis: {
              focus: 'series'
            },
            data: []
          },
          {
            name: '未处罚数',
            type: 'bar',
            stack: 'C',
            barWidth: 15,
            emphasis: {
              focus: 'series'
            },
            lineStyle: {
              color: "#c065e7",
            },
            itemStyle: {
              color: "#c065e7",
            },
            data: [150]
          },
          {
            name: '处罚数',
            type: 'bar',
            stack: 'C',
            barWidth: 15,
            emphasis: {
              focus: 'series'
            },
            lineStyle: {
              color: "#6ebffb",
            },
            itemStyle: {
              color: "#6ebffb",
            },
            data: [180]
          },
          {
            name: '',
            type: 'bar',
            stack: '',
            barWidth: 40,
            emphasis: {
              focus: 'series'
            },
            data: []
          },
          {
            name: '推送数',
            type: 'bar',
            stack: 'D',
            barWidth: 15,
            emphasis: {
              focus: 'series'
            },
            lineStyle: {
              color: "#ffd351",
            },
            itemStyle: {
              color: "#ffd351",
            },
            data: [320]
          },
          {
            name: '未推送数',
            type: 'bar',
            stack: 'D',
            barWidth: 15,
            emphasis: {
              focus: 'series'
            },
            lineStyle: {
              color: "#6a89e2",
            },
            itemStyle: {
              color: "#6a89e2",
            },
            data: [620]
          },
          {
            name: '',
            type: 'bar',
            stack: '',
            barWidth: 20,
            emphasis: {
              focus: 'series'
            },
            data: []
          },
        ]
      };
      myChartRightTwo.setOption(this.optionRightTwo, true);
    },
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值