stats_data_uvhz.js_3
2.4 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
$(function () {
var months = $('#month_str').val();
var month_arr = months.split(',');
$.each(month_arr, function(k,item_month){
$.get("/wp-admin/admin-ajax.php", { "action": "stats_data_uvhz", month :item_month},
function(data){
$('.moth_'+item_month+'_moth').html(data.moth_moth);
$('#moth_'+item_month+'_pv').html(data.moth_pv);
$('#moth_'+item_month+'_ip').html(data.moth_ip);
$('#cf_count_'+item_month).html(data.cf_count);
$('#cf_f_count_'+item_month).html(data.cf_f_count);
var country_top10_html = '';
$.each(data.country_top10, function(i,item){
country_top10_html +="<li>"+item['show_area']+"</li>"
});
$('#country_top10_'+item_month).html(country_top10_html);
var data_pv = new Array();
var data_ip = new Array();
var k=0;
$.each(data.moth['data'], function(i,item){
data_pv[k] = parseInt(item.pv);
data_ip[k] = parseInt(item.ip);
k++;
});
// 各月份数据
Highcharts.chart('view-chart-'+item_month,
{
// xAxis: {
// type: 'datetime',
// dateTimeLabelFormats: {
// day: '%m-%d'
// },
// tickWidth:0,
// lineWidth: 0,
// labels:{
// style:{
// color:'#999'
// }
// }
// },
tooltip: {
xDateFormat: item_month,
shared:true,
shadow: false,
backgroundColor: '#ffffff',
style:{
color: '#333333',
fontSize: '14px',
padding: '8px',
lineHeight:'20px'
}
},
colors: ['#ececec','#7cb0d8'],
chart:{type:'areaspline'},
plotOptions: {
series: {
lineWidth:1,
marker: {
enabled: true
},
pointStart: 1, // 开始时间
pointEnd: 31, // 结束时间
pointInterval: 1
}
},
series:[
{
name:'访客次数(PV)',lineColor:'#aaaaaa',marker: {symbol: 'circle',lineWidth: 1,lineColor: '#ffffff',fillColor: '#cccccc'},
data:eval(data_pv) // PV数据
},
{
name:'独立访客(IP)',lineColor:'#3292e0',marker: {symbol: 'circle',lineWidth: 1,lineColor: '#ffffff',fillColor: '#3292e0'},
data:eval(data_ip) // UV数据
}
]
});
}, "json");
})
});