双柱状图

描述:当前是关于Echarts图表中的 柱状图 示例。
 
            const echartsDataYear = [2016, 2017, 2018, 2019, 2020]
const echartsData = [
   [1, 2, 3, 4, 5],
   [11, 22, 33, 44, 55]
]
option = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'none'
      },
      className: 'my-tooltip-box',
      formatter: function (params) {
        var str = `<div class="my-tooltip">${params[0].name}`
        params.forEach((el) => {
          str += `<div><span class="name large">${el.seriesName}:</span><span class="value">${el.value}</span></div>`
        })
        str += '</div>'
        return str
      }
    },
    xAxis: {
      data: echartsDataYear,
      axisLine: {
        show: true, // 隐藏X轴轴线
        lineStyle: {
          color: '#EEEEEE',
          width: 2
        }
      },
      axisTick: {
        show: false // 隐藏X轴刻度
      },
      axisLabel: {
        show: true,
        textStyle: {
          color: '#9B9B9B', // X轴文字颜色
          fontSize: 14
        }
      }
    },
    yAxis: [
      {
        type: 'value',
        name: '单位:万人',
        nameTextStyle: {
          color: '#9B9B9B',
          padding: [0, 0, 0, 10],
          fontSize: 14
        },
        splitLine: {
          show: true,
          lineStyle: {
            type: 'dashed'
          }
        },
        axisTick: {
          show: false
        },
        axisLine: {
          show: false
        },
        axisLabel: {
          show: true,
          textStyle: {
            color: '#9B9B9B',
            fontSize: 14
          }
        }
      }
    ],
    series: [
      {
        name: '养老',
        type: 'bar',
        barWidth: 14,
        itemStyle: {
          normal: {
            color: 'rgba(47,84,237,0.35)',
            borderColor: '#2F54ED',
            borderWidth: 2
          }
        },
        data: echartsData[0]
      },
      {
        name: '医疗',
        type: 'bar',
        barWidth: 14,
        itemStyle: {
          normal: {
            color: 'rgba(54,164,255,0.35)',
            borderColor: '#36A4FF',
            borderWidth: 2
          }
        },
        data: echartsData[1]
      }
    ]
  }