reportforms.js
4.8 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/**
* @name angularjsApp.controller:homeCtrl
*/
/**=========================================================
* Module: flot-chart.js
* Setup options and data for flot chart directive
=========================================================*/
App.controller('reportformsCtrl', ['$scope', '$timeout', function($scope, $timeout) {
'use strict';
}]);
//下属邮件-月统计图
App.directive('hjsTongjiSelf', function (ChartInfo) {
'use strict';
return {
restrict: 'EA',
replate:true,
template:"<div id='usertongji' style='width: 100%;'></div>",
controller:function($scope){
var postdata={
condition:1,
conditionvalue:"",
loginid:""
};
ChartInfo.tongji(postdata).then(function(data){
var msend=[];
for(var i=1;i<13; i++){
msend.push(data.monthsend[i])
}
var mclick=[];
for(var i=1;i<13; i++){
mclick.push(data.monthclick[i])
}
var mreply=[];
for(var i=1;i<13; i++){
mreply.push(data.monthreply[i])
}
var mun=[];
for(var i=1;i<13; i++){
mun.push(data.monthun[i])
}
$("#usertongji").highcharts({
chart: {
type: 'column'
},
title: {
text: '月统计图'
},
xAxis: {
categories: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
},
yAxis: {
min: 0,
title: {
text: '数量'
}
},
exporting: {
enabled: false
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} </b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: '月发送量',
data: msend
}, {
name: '月点击总量',
data: mclick
}, {
name: '月回复总量',
data: mreply
}, {
name: '月退订总量',
data: mun
}]
});
})
}
}
})
//下属邮件-月走势图
.directive('hjsZoushiSelf', function (ChartInfo) {
'use strict';
return {
restrict: 'EA',
replate:true,
template:"<div id='userzoushi' style='width: 100%;'></div>",
controller:function($scope){
var postdata={
condition:1,
conditionvalue:"",
loginid:""
};
ChartInfo.tongji(postdata).then(function(data) {
console.log(data)
var msend = [];
for (var i = 1; i < 13; i++) {
msend.push(data.monthsend[i])
}
var mclick = [];
for (var i = 1; i < 13; i++) {
mclick.push(data.monthclick[i])
}
var mreply = [];
for (var i = 1; i < 13; i++) {
mreply.push(data.monthreply[i]);
}
var mun = [];
for (var i = 1; i < 13; i++) {
mun.push(data.monthun[i]);
}
$('#userzoushi').highcharts({
chart: {
type: 'line'
},
title: {
text: '月统计走势图'
},
xAxis: {
categories: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
},
yAxis: {
title: {
text: '百分比率(%)'
}
},
exporting: {
enabled: false
},
tooltip: {
enabled: false,
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' + this.x + ': ' + this.y + '°C';
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
series: [{
name: '退订',
data: mun
}, {
name: '点击',
data: mclick
}, {
name: '回复',
data: mreply
}]
});
})
}
}
})