Bar 4

描述:当前是关于Echarts图表中的 柱状图 示例。
 
             option = {
   backgroundColor:"#000",
    tooltip: {
        trigger: "axis"
    },
       legend: {
          itemHeight:14,
          itemWidth:14,
          icon: "rect",
          bottom: 20, 
          right:20,
          textStyle: {
            color: "rgba(255,255,255,0.5)",
          },
        },
        grid: {
          x: 100,
          y: 20,
          x2: 30,
          y2: 100,
        },
        xAxis: {
            axisLine: {
             show:true,
            lineStyle: {
              color: "rgba(255,255,255,0.5)",
            },
          },
          axisLabel: {
            textStyle: {
              color: "rgba(255,255,255,0.5)",
            },
          },
          show: true,
          type: "value",
          axisTick: {
            show: false,
          },
          splitLine: {//纵向分隔线
                show: true,
                lineStyle: {
                    color: 'rgba(255,255,255,0.5)',
                    type: "dotted",
                }
            },
        },
        yAxis: {
          data: ["2017", "2018", "2019", "2020","2021"],
          axisLine: {
            lineStyle: {
              color: 'rgba(255,255,255,0.5)',
              type: "dotted",
            },
          },
          axisLabel: {
            textStyle: {
              color: "rgba(255,255,255,0.5)",
            },
          },
          axisTick: {
            show: false,
          },
          splitLine: {
            show: false,
          },
        },
        series: [
          {
            name: "水库",
            type: "bar",
            stack: "all",
            barWidth: 26,
            data: [5, 3, 8, 9, 3],
            // 设置柱状图渐变
            itemStyle: {
               color:'#5A3FFF'
                 
            },
          },
          {
            name: "湿地",
            type: "bar",
            stack: "all",
            barWidth: 26,
            data: [3, 4, 5, 2, 1],
            itemStyle: {
                color: '#268AFF'
                 
            },
          },
          {
            name: "调蓄带",
            type: "bar",
            stack: "all",
            barWidth: 26,
            data: [1, 3, 2, 4, 4],
            itemStyle: {
                color: '#1ED6FF'
                 
            },
          },
         
        ],
      };