-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
139 lines (126 loc) · 3.48 KB
/
index.html
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="https://cdn.bootcss.com/highcharts/4.2.5/highcharts.js" type="text/javascript" ></script>
<script src="jquery.scrollLoading.js" type="text/javascript" ></script>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
background-color: #EBEBEB;
overflow:hidden;
}
#report_table{
width:100%;
height:100%;
overflow:auto;
}
#report_table .chart{
margin:auto;
border-bottom:1px solid #A4BED4;
width: 100%;
height:400px;
}
</style>
<script>
$(function(){
$(".chart").each(function(index,elem ){
$(elem ).scrollLoading({
container: $("#report_table"), //滚动对象,监听该对象的滚动事件,很关键。
callback: function(){ //加载到可见范围的回调事件
loadChart($(elem ));
},
preloadHeight:400 //预加载高度
});
});
function loadChart(obj){
var options = {
title: {
text: $(obj).attr("id")
},
subtitle: {
text: '数据来源:thesolarfoundation.com'
},
yAxis: {
title: {
text: '就业人数'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},
plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 2010
}
},
series: [{
name: '安装,实施人员',
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
}, {
name: '工人',
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
}, {
name: '销售',
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
}, {
name: '项目开发',
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
}, {
name: '其他',
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
}],
responsive: {
rules: [{
condition: {
maxWidth: 500
},
chartOptions: {
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom'
}
}
}]
}
};
setTimeout(function(){
obj.highcharts(options);
},800);
}
});
</script>
</head>
<body>
<div id="report_table">
<div class="chart" id="chart1"></div>
<div class="chart" id="chart2"></div>
<div class="chart" id="chart3"></div>
<div class="chart" id="chart4"></div>
<div class="chart" id="chart5"></div>
<div class="chart" id="chart6"></div>
<div class="chart" id="chart7"></div>
<div class="chart" id="chart8"></div>
<div class="chart" id="chart9"></div>
<div class="chart" id="chart10"></div>
<div class="chart" id="chart11"></div>
<div class="chart" id="chart12"></div>
<div class="chart" id="chart13"></div>
<div class="chart" id="chart14"></div>
<div class="chart" id="chart15"></div>
<div class="chart" id="chart16"></div>
<div class="chart" id="chart17"></div>
</div>
</body>
</html>