index.html
4.0 KB
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
<include file="public@header"/>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">数据统计</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('AdminData/index')}">
请选择:
<select class="form-control" name="time" style="width: 140px;">
<option value='0'>全部</option>
<option value="7" <eq name="7" value="$time">selected</eq> >最近7天</option>
<option value="30" <eq name="30" value="$time">selected</eq> >最近30天</option>
</select>
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
style="width: 140px;" autocomplete="off">-
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('AdminData/index')}">清空</a>
</form>
<form class="well form-inline margin-top-20" method="post" action="{:url('AdminData/index')}">
<span style="margin-left: 35%">总浏览量:{$total_num}</span>
<span style="margin-left: 10%">今日浏览量:{$today_num}</span>
</form>
<div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div>
<div id="container2" style="width: 550px; height: 400px; margin: 0 auto"></div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script language="JavaScript">
$(document).ready(function() {
var title = {
text: '流量变化'
};
var subtitle = {
text: ''
};
var xAxis = {
categories: {$list1}
};
var yAxis = {
title: {
text: '访问量',
},
allowDecimals:false
};
var plotOptions = {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: true,
}
};
var series= [{
name: '流量走势',
data: {$list2}
}];
var json = {};
json.title = title;
json.subtitle = subtitle;
json.xAxis = xAxis;
json.yAxis = yAxis;
json.series = series;
json.plotOptions = plotOptions;
$('#container').highcharts(json);
});
</script>
<script language="JavaScript">
$(document).ready(function() {
var datalist = {$list3};
console.log(datalist);
var chart = {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
};
var title = {
text: '地区排行'
};
var tooltip = {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
};
var plotOptions = {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}%</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
};
var series= [{
type: 'pie',
name: '所占比例',
data: {$list3}
}];
var json = {};
json.chart = chart;
json.title = title;
json.tooltip = tooltip;
json.series = series;
json.plotOptions = plotOptions;
$('#container2').highcharts(json);
});
</script>
</body>
</html>