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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
| <!DOCTYPE html>
| <html>
|
| <head>
| <meta charset="UTF-8">
| <title>图表测试</title>
| <script src="http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
| <script src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
| <script src="http://cdn.hcharts.cn/highcharts/modules/exporting.js"></script>
| </head>
|
| <body>
| <div id="container" style="min-width:400px;height: 800px;"></div>
| <div id="container1" style="min-width:400px;height: 800px;"></div>
| </body>
| <script src="js/nav.js"></script>
| <script src="js/common.js"></script>
| <script type="text/javascript">
| $(function() {
| $('#container').highcharts({
| chart: {
| type: 'bar'
| },
| title: {
| text: '视频观看次数'
| },
| xAxis: {
| categories: ['视频', '视频2', '视频3', '视频4', '视频5', '视频6'],
|
| },
| yAxis: {
| min: 0,
| labels: {
| overflow: 'justify'
| }
| },
|
| plotOptions: {
| bar: {
| dataLabels: {
| enabled: true
| }
| }
| },
| legend: {
| layout: 'vertical',
| align: 'right',
| verticalAlign: 'top',
| x: -40,
| y: 100,
| floating: true,
| borderWidth: 1,
| backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
| shadow: true
| },
| credits: {
| enabled: false
| },
| series: [{
| name: '视频观看数',
| data: [2000, 1000, 500, 300, 200, 20]
| }]
| });
|
| //折线图
| $('#container1').highcharts({
| title: {
| text: '视频观看次数',
| x: -20 //center
| },
| xAxis: {
| categories: ['20160101', '20160102', '20160103', '20160104'
| ]
| },
| yAxis: {
| title: {
| text: '次数 '
| },
| plotLines: [{
| value: 0,
| width: 1,
| color: '#808080'
| }]
| },
| tooltip: {
| valueSuffix: '次'
| },
| legend: {
| layout: 'vertical',
| align: 'right',
| verticalAlign: 'middle',
| borderWidth: 0
| },
| series: [{
| name: '观看数量',
| data: [10000, 20100, 4000, 15000]
| }]
| });
|
| });
| </script>
|
| </html>
|
|