1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
| <!DOCTYPE html>
| <html>
| <head>
| <title>mp4.html</title>
| <meta http-equiv="Expires" content="0" />
| <meta http-equiv="Cache" content="no-cache" />
| <meta http-equiv="Pragma" content="no-cache" />
| <meta http-equiv="Cache-control" content="no-cache" />
| <link href="imgs/favicon.ico" rel="icon" type="image/x-icon" />
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
| <style>
| html, body, #main {
| margin: 0;
| padding: 0;
| width: 100%;
| height: 100%;
| overflow: hidden;
| }
| </style>
| <script src="js/jquery-1.11.3.min.js"></script>
| <script src="js/echarts.js"></script>
| <script>
| function getQueryString(name) {
| var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
| var r = window.location.search.substring(1).match(reg);
| if (r != null) {
| return decodeURI(r[2]);
| };
| return null;
| }
|
| $(function () {
| init();
| });
|
| function init() {
| // 基于准备好的dom,初始化echarts图表
| var myChart = echarts.init(document.getElementById('main'));
|
| var option = {
| tooltip: {
| show: true
| },
| legend: {
| data: ['销量']
| },
| xAxis: [
| {
| type: 'category',
| data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
| }
| ],
| yAxis: [
| {
| type: 'value'
| }
| ],
| series: [
| {
| "name": "销量",
| "type": "bar",
| "data": [5, 20, 40, 10, 10, 20]
| }
| ]
| };
|
| // 为echarts对象加载数据
| myChart.setOption(option);
| }
| </script>
| </head>
| <body>
| <div id="main">
|
| </div>
| </body>
| </html>
|
|