domaincount.js
4.5 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// 程序名称: 时速邮件管理系统(EsMail)
// 程序版本: V2.0
// 作 者: 深圳市科飞时速网络技术有限公司(0755-88843776)
// 版权所有: 深圳市科飞时速网络技术有限公司
// 技术支持: Tech@21gmail.com
// 单元名称: 域总统计js文件
// 开始时间: 2013.11.1
// 程 序 员: 谢勇
// 最后修改: 2013.11.1
// 备 注:
$(document).ready(function(){
//查询域总统计(总发量,总点读量,总未点读量,总回复量,总订阅量,总退订量)
findDomainCountInfo();
});
//查询统计信息
function findDomainCountInfo(){
$.ajax({
type: "post",
url: "yxyC_findCountDomain.action",
dataType:"json",
error: function() {alert("异常");},
success: function(msg) {
$("#domain_tolnum").html(msg["sendTol"]);//总量
$("#domain_clickTol").html(msg["clickTol"]);//点击总量
$("#domain_NoClickTol").html(msg["noclickTol"]);//未点击总量
$("#domain_unTol").html(msg["unTol"]);//退订量
var clickBai=parseFloat((msg["clickTol"]/msg["sendTol"]));
if(msg["clickTol"]!=0&&msg["sendTol"]!=0){
$("#domain_clickBai").html((clickBai*100).toFixed(2)+"%");//点击百分比
nosendTolb=parseFloat((clickBai*100).toFixed(2));
}
var noClickBai=parseFloat((msg["noclickTol"]/msg["sendTol"]));
if(msg["noclickTol"]!=0&&msg["sendTol"]!=0){
$("#domain_noClickBai").html((noClickBai*100).toFixed(2)+"%");//未点击百分比
tdTolb=parseFloat((noClickBai*100).toFixed(2));
}
var UnBai=parseFloat(msg["unTol"]/msg["sendTol"]);
if(msg["unTol"]!=0&&msg["sendTol"]!=0){
$("#domain_unBai").html((UnBai*100).toFixed(2)+"%");//退订击百分比
unTolb=parseFloat((UnBai*100).toFixed(2));
}
zhuzi();
}
});
}
//柱子图
function zhuzi(){
var pmg=$(window).height();
$(".yx_con1").css("height",pmg);
var colors = Highcharts.getOptions().colors,
categories = ['发送', '点读', '未读', '回复', '订阅', '退订'],
data = [{
y: sendTolb,
color: colors[7]
}, {
y: nosendTolb,
color: colors[1]
}, {
y: tdTolb,
color: colors[2]
}, {
y: 0,
color: colors[3]
}, {
y: 0,
color: colors[4]
},{
y: unTolb,
color: colors[5]
}];
function setChart(name, categories, data, color) {
chart.xAxis[0].setCategories(categories, false);
chart.series[0].remove(false);
chart.addSeries({
data: data,
color: color || 'white'
}, false);
chart.redraw();
}
var chart = $('#homecom').highcharts({
chart: {
type: 'column'
},
title: {
text: null
},
credits:{
enabled:false // 禁用版权信息
},
xAxis: {
categories: categories
},
yAxis: {
title: {
text: '单位:率百分比统计'
}
},
plotOptions: {
column: {
cursor: 'pointer',
point: {
events: {
click: function() {
var drilldown = this.drilldown;
if (drilldown) { // drill down
setChart(drilldown.name, drilldown.categories, drilldown.data, drilldown.color);
} else { // restore
setChart(name, categories, data);
}
}
}
},
dataLabels: {
enabled: true,
color: colors[0],
style: {
fontWeight: 'bold'
},
formatter: function() {
return this.y +'%';
}
}
}
},
legend: {
enabled: false
},
tooltip: {
formatter: function() {
var point = this.point,
s = this.x +':<b>'+ this.y +'% </b><br/>';
return s;
}
},
series: [{
name: name,
data: data,
color: 'white'
}],
exporting: {
enabled: false
}
})
.highcharts();
}