柱状图

描述:当前是关于Echarts图表中的 柱状图 示例。
 
            
option = {
   backgroundColor: 'white',
   //标题
   title: {
      show: true,
      text: 'Echarts柱状图示例',
      top: '3%',
      left: 'center',
      textStyle: {
         color: 'red',
         fontSize: 20
      }
   },
   //下载按钮
   toolbox: {
      show: true,
      top: '2%',
      right: '4%',
      feature: {
         saveAsImage: { name: '下载标题' }
      }
   },
   //图表离容器的距离
   grid: {
      left: "10%",
      top: "10%",
      right: "10%",
      bottom: "10%",
   },
   //X轴
   xAxis: {
      data: ['库里', '科比', '詹姆斯', '乔丹', '杜兰特', '欧文', '威少'],
      axisLabel: {
         textStyle: {
            color: 'black',
            fontSize: 16
         }
      },
      axisTick: {
         show: false //隐藏X轴刻度尺
      },
   },
   //y轴
   yAxis: {
      axisLabel: {
         textStyle: {
            color: 'black',
            fontSize: 16
         }
      }
   },
   series: [{
      data: [2, 1, 4, 6, 1, 0, 1],
      label: {
         show: true,
         position: "top",
         distance: 0,
         color: "grey",
         formatter: "{c}" + "MVP",
      },
      name: '球星',
      //图表类型
      //折线图line,饼图pie,散点图scatter等等
      type: 'bar',
      barWidth: 30,
      itemStyle: {
         barBorderRadius: [20, 20, 0, 0],
         color: {
            x: 0,  //右
            y: 0,  //下
            x2: 0,  //左
            y2: 1,  //上
            colorStops: [
               {
                  offset: 0.1,
                  color: '#00B4DB' // 0% 处的颜色
               },
               {
                  offset: 1,
                  color: '#0083B0' // 100% 处的颜色
               }
            ]
         }
      }
   }]
}