SOURCE

console 命令行工具 X clear

                    
>
console
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));

// 指定图表的配置项和数据
var option = {
  "title": {
    "text": "堆叠区域图"
  },
  "tooltip": {
    "trigger": "axis",
    "axisPointer": {
      "type": "cross",
      "label": {
        "backgroundColor": "#6a7985"
      }
    }
  },
  "legend": {
    "data": ["邮件营销", "联盟广告", "视频广告", "直接访问", "搜索引擎"]
  },
  "toolbox": {
    "feature": {
      "saveAsImage": {

}
    }
  },
  "grid": {
    "left": "3%",
    "right": "4%",
    "bottom": "3%",
    "containLabel": true
  },
  "xAxis": [{
    "type": "category",
    "boundaryGap": false,
    "data": ["1981",
"1982",
"1983",
"1984",
"1985",
"1986",
"1987",
"1988",
"1989",
"1990",
"1991",
"1992",
"1993",
"1994",
"1995",
"1996",
"1997",
"1998",
"1999",
"2000",
"2001",
"2002",
"2003",
"2004",
"2005",
"2006",
"2007",
"2008",
"2009",
"2010",
"2011",
"2012",
"2013",
"2014",
"2015",
"2016"

    ]
  }],
  "yAxis": [{
    "type": "value"
  }],
  "series": [{
    "name": "搜索引擎",
    "type": "line",
    "stack": "总量",
    "label": {
      "normal": {
        "show": true,
        "position": "top"
      }
    },
    "areaStyle": {
      "normal": {

}
    },
    "data": [ 	 2077.88,
	 2247.69,
	 2065.91,
	 2063.12,
	 2211.23,
	 2392.61,
	 2528.79,
	 2290.74,
	 2413.86,
	 2390.53,
	 2264.60,
	 2124.80,
	 2123.70,
	 2109.45,
	 2062.65,
	 2067.34,
	 2038.18,
	 1942.34,
	 1833.98,
	 1771.46,
	 1701.72,
	 1646.58,
	 1598.89,
	 1592.86,
	 1616.60,
	 1585.01,
	 1594.63,
	 1608.12,
	 1614.95,
	 1574,
	 1604,
	 1635,
	 1640,
	 1687,
	 1655,
	 1786 ]
  }]
};

// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
<script src="//cdn.bootcss.com/echarts/3.6.1/echarts.simple.min.js">
</script>
1981年到今 历年出生人口统计表 (单位: 万人)
<div id="main" style="width:1000px;height:400px;">
</div>
body {
  background: #FFF;
}