渐变柱状图

描述:当前是关于Echarts图表中的 柱状图 示例。
 
            var data = [
   ["2000年", 50.5],
   ["2001年",49],
   ["2002年",45],
   ["2003年",40],
   ["2004年",30],
   ["2005年",28],
   ["2006年", 25],
   ["2007年", 20],
   ["2008年",15],
   ["2009年",13],
   ["2010年", 10],
   ["2011年", 5]
]
option = {
   dataset: {
      source: data,
   },
   grid: {
      top: 0,
      bottom: "0",
      right: "20%",
      left: "20%",
   },
   xAxis: {
      type: "value",
      show: false,
      inverse: true,
   },
   yAxis: {
      type: "category",
      inverse: true,
      position: "right",
      axisLabel: {
         show: true,
         textStyle: {
            color: "#828282",
            fontSize:18,
         },
      },
      axisLine: {
         position: "right",
         show: true,
         lineStyle: {
            with: 2,
            color: "#ffa620",
            type: "dashed",
         },
      },
      axisTick: {
         show: false,
      },
   },
   series: {
      name: "数量 (万件)",
      type: "bar",
      label: {
         position: "left", //数量字体方向
         show: true,
         fontSize: 18,
         color: "#333",
         formatter: function (params) {
            return params.data[1];
         },
      },
      color: [
         {
            type: "linear",
            x: 1,
            y: 0,
            x2: 0,
            y2: 0,
            colorStops: [
               {
                  offset: 0,
                  color: "#f49afc", // 0% 处的颜色
               },
               {
                  offset: 1,
                  color: "#ed1fff", // 100% 处的颜色
               },
            ],
            global: false, // 缺省为 false
         },
      ],
   },
};