Bar 2

描述:当前是关于Echarts图表中的 柱状图 示例。
 
             option = {
   backgroundColor:"#000",
    tooltip: {
        trigger: "axis"
    },
       legend: {
          itemHeight:14,
          itemWidth:14,
          icon: "rect",
          bottom: "0", 
          textStyle: {
            color: "rgba(255,255,255,0.5)",
          },
        },
        grid: {
          x: 80,
          y:50,
         
        },
        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: ["Beijing", "Guangzhou", "Shenzhen", "Shanghai","Chengdu","Wuhan","Changsha"],
          axisLine: {
            lineStyle: {
              color: "rgba(255,255,255,0.5)",
            },
          },
          axisLabel: {
            textStyle: {
              color: "rgba(255,255,255,0.5)",
            },
          },
          axisTick: {
            show: false,
          },
          splitLine: {
            show: false,
          },
        },
        series: [
          {
            name: "水库",
            type: "bar",
            stack: "all",
            barWidth:20,
            data: [15, 33, 48, 69, 23, 47, 37, 61, 53, 80],
            // 设置柱状图渐变
            itemStyle: {
                color: new echarts.graphic.LinearGradient(1, 0, 0,0 , [
                    {
                        offset: 0,
                        color: '#36F097',
                    },
                    {
                        offset: 1,
                        color: 'rgba(54,240,151,0.2)',
                    },
                ]),
            },
           
          },
        ],
      };