EChart横向图表

在这里插入图片描述

  let myChart = this.$echarts.init(document.getElementById('deviceAlarmStatus'))
      myChart.setOption({
        //        tooltip: {},
        title: {
          text: '昨日用电量65kw/h',
          textStyle: {
            color: '#fff',
            fontSize: 14,
            fontWeight: 100,
            fontSize: 22,
          },
            x: 'center',
            // y:"center",
            top: '40%',
            left: '20%',
        },
        xAxis: {
          max: 100,
          splitLine: {
            show: false
          },
          offset: 10,
          axisTick: {
            show: false
          },
          axisLine: {
            show: false
          },
          axisLabel: {
            show: false
          }
        },
        yAxis: [{
          type: "category",
          inverse: false,
          data: ['照明', '微基站', '信息发布屏'],
          position: 'left',
          axisLine: {
            show: false
          },
          axisTick: {
            show: false
          },
          axisLabel: {
            show: false
          }
        }, ],
        grid: {
          top: '20%',
          left: 120,
          right: 50,
          bottom: 20
        },
        series: [{
          // current data
          type: 'pictorialBar',
          symbol: 'rect',
          symbolRepeat: 'fixed',
          symbolMargin: '20%',
          symbolClip: true,
          symbolSize: [10, 20],
          symbolBoundingData: 100,
          label: {
            normal: {
              show: true,
              position: 'right',
              offset: [0, 0],
              textStyle: {
                color: '#66e7f9',
                fontSize: 18,
                fontWeight: 'bold',
              }
            }
          },
          data: [{
              "value": 56,
              "itemStyle": {
                "normal": {
                  "color": "#ff1578"
                }
              }
            },
            {
              "value": 65,
              "itemStyle": {
                "normal": {
                  "color": "#8e49ff"
                }
              }
            },
            {
              "value": 30,
              "itemStyle": {
                "normal": {
                  "color": "#4261f9"
                }
              }
            },
          ],
          z: 99999999,
          animationEasing: 'elasticOut',
          animationDelay: function(dataIndex, params) {
            return params.index * 30;
          }
        }, {
          // full data
          type: 'pictorialBar',
          itemStyle: {
            normal: {
              color: '#192670'
            }
          },
          label: {
            normal: {
              show: true,
              position: 'right',
              offset: [10, 0],
              textStyle: {
                color: 'darkorange',
                fontSize: 16
              }
            }
          },
          animationDuration: 0,
          symbolRepeat: 'fixed',
          symbolMargin: '20%',
          symbol: 'rect',
          symbolSize: [10, 20],
          symbolBoundingData: 100,
          data: [{
              "value": 100,
              label: {
                normal: {
                  show: true,
                  position: [-100, 15],
                  formatter: '{b}',
                  offset: [10, 0],
                  textStyle: {
                    color: '#fff',
                    fontSize: 16
                  }
                }
              }
            },
            {
              "value": 100,
              label: {
                normal: {
                  show: true,
                  position: [-100, 15],
                  formatter: '{b}',
                  offset: [10, 0],
                  textStyle: {
                    color: '#fff',
                    fontSize: 16
                  }
                }
              }
            },
            {
              "value": 100,
              label: {
                normal: {
                  show: true,
                  position: [-100, 15],
                  formatter: '{b}',
                  offset: [10, 0],
                  textStyle: {
                    color: '#fff',
                    fontSize: 16
                  }
                }
              }
            }
          ],
          z: 99999,
          animationEasing: 'elasticOut',
          animationDelay: function(dataIndex, params) {
            return params.index * 30;
          }
        }]
      });
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值