双y轴----(左侧Y轴)堆叠图+(右侧Y轴)折线图

 

option = {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross'
    }
  },
  legend: {
    textStyle: {
      color: '#ffffff'
    },
    data: ['已使用', '未使用', '使用率']
  },
  grid: {
    left: '5%',
    right: '5%',
    bottom: '5%',
    top: '20%',
    containLabel: true
  },
  xAxis: [
    {
      type: 'category',
      axisTick: false,
      axisLine: {
        show: false,
        lineStyle: {
          color: '#00548D',
          width: 0.5
        }
      },
      axisLabel: {
        textStyle: {
          color: '#ffffff'
        }
      },
      data: ['name1', 'name2', 'name3', 'name3', 'name4', 'name45']
    }
  ],
  yAxis: [
    {
      type: 'value',
      name: '(个)',
      position: 'left',
      alignTicks: true,
      splitLine: { show: false },
      nameTextStyle: { color: '#ffffff' },
      axisLine: {
        show: true,
        lineStyle: {
          color: '#00548D',
          width: 0.5
        }
      },
      axisLabel: {
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    {
      type: 'value',
      name: '(%)',
      position: 'right',
      alignTicks: true,
      splitLine: { show: false },
      nameTextStyle: { color: '#ffffff' },
      axisLine: {
        show: true,
        lineStyle: {
          color: '#00548D',
          width: 0.5
        }
      },
      axisLabel: {
        textStyle: {
          color: '#ffffff'
        }
      }
    }
  ],
  series: [
    {
      name: '已使用',
      type: 'bar',
      stack: 'total',
      yAxisIndex: 0,
      barWidth: 20,
      itemStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
            {
              offset: 0,
              color: '#02C9B4'
            },
            {
              offset: 1,
              color: '#02C9B488'
            }
          ])
        }
      },
      data: [1, 3, 1, 2, 6, 2]
    },
    {
      name: '未使用',
      type: 'bar',
      stack: 'total',
      yAxisIndex: 0,
      barWidth: 20,
      itemStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
            {
              offset: 0,
              color: '#C89936'
            },
            {
              offset: 1,
              color: '#C8993688'
            }
          ])
        }
      },
      data: [2, 3, 1, 3, 2, 3]
    },
    {
      name: '使用率',
      type: 'line',
      yAxisIndex: 1,
      emphasis: {
        focus: 'series'
      },
      itemStyle: {
        color: '#188BD9'
      },
      data: [20, 10, 14, 38, 56, 80]
    }
  ]
};

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值