堆叠柱状图

描述:当前是关于Echarts图表中的 柱状图 示例。
 
            option = {
   "legend": {
      /*"x": "right",*/
      right: 40,
      "textStyle": {
         "color": "white",
         "fontSize": 14
      },
      "top": 12,
      "itemWidth": 20,
      "itemHeight": 10,
      "itemGap": 20
   },
   "color": [
      {
         type: 'linear',
         x: 0,
         y: 0,
         x2: 0,
         y2: 1,
         colorStops: [
            {
               offset: 0,
               color: 'rgba(251, 210, 65, 1)'
            },
            {
               offset: 1,
               color: 'rgba(251, 210, 65, 0.35)'
            }
         ]
      },
      {
         type: 'linear',
         x: 0,
         y: 0,
         x2: 0,
         y2: 1,
         colorStops: [
            {
               offset: 0,
               color: 'rgba(250, 109, 62, 1)'
            },
            {
               offset: 1,
               color: 'rgba(250, 109, 62, 0.35)'
            }
         ]
      },
      {
         type: 'linear',
         x: 0,
         y: 0,
         x2: 0,
         y2: 1,
         colorStops: [
            {
               offset: 0,
               color: 'rgba(240, 244, 255, 1)'
            },
            {
               offset: 1,
               color: 'rgba(240, 244, 255, 0.35)'
            }
         ]
      },
      {
         type: 'linear',
         x: 0,
         y: 0,
         x2: 0,
         y2: 1,
         colorStops: [
            {
               offset: 0,
               color: 'rgba(107, 112, 124, 1)'
            },
            {
               offset: 1,
               color: 'rgba(107, 112, 124, 0.35)'
            }
         ]
      },
   ],
   "backgroundColor": "#1B232E",
   "tooltip": {
      "trigger": "axis",
      "axisPointer": {
         "type": "shadow"
      },
      textStyle: {
         color: "rgba(255, 255, 255, 1)"
      },
      backgroundColor: "rgba(0,0,0,0.8)",
      borderColor: "rgba(219, 230, 255, 0.8)",

   },
   xAxis: {
      "data": [
         "01", "02", "03", "04", "05", "06", "07", "08", "09", "10"
      ],
      name: '日',
      axisLabel: {
         color: "#A9AEB2"//单位值的颜色
      },
      axisLine: {
         lineStyle: {
            color: '#A9AEB2'//轴线和单位颜色
         }
      },
      axisTick: {//刻度颜色
         lineStyle: {
            color: '#A9AEB2'
         }
      }
   },
   yAxis: {
      name: 'kWh',
      axisLabel: {
         color: "#A9AEB2"
      },
      axisLine: {
         lineStyle: {
            color: '#A9AEB2'
         }
      },
      axisTick: {
         lineStyle: {
            color: '#A9AEB2'
         }
      },
      splitLine: {
         "show": true,
         "lineStyle": {
            "color": [
               "#43485E"
            ],
            "width": 1,
            "type": "solid"
         },
      },
      grid: {
         bottom: 100
      },
   },
   series: [
      {
         name: "尖",
         type: "bar",
         stack: "total",
         label: {
            show: false,
            color: "#FFFFFF",
            formatter: function (e) {
               // return e.value ? e.value : "";
               // return e.value ? e.seriesName : "";
            },
         },
         itemStyle: {
            borderRadius: [0, 0, 0, 0],
         },
         barWidth: 20,
         emphasis: {
            focus: "series",
         },
         data: [320, 302, 120, 100, 540, 123, 345, 667, 333, 122, 211, 99],
      },
      {
         name: "峰",
         type: "bar",
         stack: "total",
         label: {
            show: false,
            color: "#FFFFFF",
            formatter: "{a}",
         },
         emphasis: {
            focus: "series",
         },
         data: [320, 302, 120, 100, 540, 123, 345, 667, 333, 122, 211, 99],
      },
      {
         name: "平",
         type: "bar",
         stack: "total",
         label: {
            show: false,
            color: "#FFFFFF",
            formatter: "{a}",
         },
         emphasis: {
            focus: "series",
         },
         data: [320, 302, 120, 100, 540, 123, 345, 667, 333, 122, 211, 99],
      },
      {
         name: "谷",
         type: "bar",
         stack: "total",
         label: {
            show: false,
            color: "#FFFFFF",
            formatter: "{a}",
         },
         itemStyle: {
            borderRadius: [0, 0, 0, 0],
         },
         emphasis: {
            focus: "series",
         },
         data: [320, 302, 120, 100, 540, 123, 345, 667, 333, 122, 211, 99],
      },
   ],
}