|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+/**
|
|
|
2
|
+ * Created by xuxueli on 17/4/24.
|
|
|
3
|
+ */
|
|
|
4
|
+
|
|
|
5
|
+
|
|
|
6
|
+$(function () {
|
|
|
7
|
+
|
|
|
8
|
+ // lineChart
|
|
|
9
|
+ var lineChart = echarts.init(document.getElementById('lineChart'));
|
|
|
10
|
+ lineChart.setOption(lineChartDate());
|
|
|
11
|
+
|
|
|
12
|
+ function lineChartDate() {
|
|
|
13
|
+ var option = {
|
|
|
14
|
+ title: {
|
|
|
15
|
+ text: '日期分布图'
|
|
|
16
|
+ },
|
|
|
17
|
+ tooltip : {
|
|
|
18
|
+ trigger: 'axis',
|
|
|
19
|
+ axisPointer: {
|
|
|
20
|
+ type: 'cross',
|
|
|
21
|
+ label: {
|
|
|
22
|
+ backgroundColor: '#6a7985'
|
|
|
23
|
+ }
|
|
|
24
|
+ }
|
|
|
25
|
+ },
|
|
|
26
|
+ legend: {
|
|
|
27
|
+ data:['成功调度次数','失败调度次数']
|
|
|
28
|
+ },
|
|
|
29
|
+ toolbox: {
|
|
|
30
|
+ feature: {
|
|
|
31
|
+ saveAsImage: {}
|
|
|
32
|
+ }
|
|
|
33
|
+ },
|
|
|
34
|
+ grid: {
|
|
|
35
|
+ left: '3%',
|
|
|
36
|
+ right: '4%',
|
|
|
37
|
+ bottom: '3%',
|
|
|
38
|
+ containLabel: true
|
|
|
39
|
+ },
|
|
|
40
|
+ xAxis : [
|
|
|
41
|
+ {
|
|
|
42
|
+ type : 'category',
|
|
|
43
|
+ boundaryGap : false,
|
|
|
44
|
+ data : ['2017-10-01','2017-10-02','2017-10-03','2017-10-04','2017-10-05','2017-10-06','2017-10-07']
|
|
|
45
|
+ }
|
|
|
46
|
+ ],
|
|
|
47
|
+ yAxis : [
|
|
|
48
|
+ {
|
|
|
49
|
+ type : 'value'
|
|
|
50
|
+ }
|
|
|
51
|
+ ],
|
|
|
52
|
+ series : [
|
|
|
53
|
+ {
|
|
|
54
|
+ name:'成功调度次数',
|
|
|
55
|
+ type:'line',
|
|
|
56
|
+ stack: '总量',
|
|
|
57
|
+ areaStyle: {normal: {}},
|
|
|
58
|
+ data:[820, 932, 901, 934, 1290, 1330, 1320]
|
|
|
59
|
+ },
|
|
|
60
|
+ {
|
|
|
61
|
+ name:'失败调度次数',
|
|
|
62
|
+ type:'line',
|
|
|
63
|
+ stack: '总量',
|
|
|
64
|
+ label: {
|
|
|
65
|
+ normal: {
|
|
|
66
|
+ show: true,
|
|
|
67
|
+ position: 'top'
|
|
|
68
|
+ }
|
|
|
69
|
+ },
|
|
|
70
|
+ areaStyle: {normal: {}},
|
|
|
71
|
+ data:[120, 132, 101, 134, 90, 230, 210]
|
|
|
72
|
+ }
|
|
|
73
|
+ ],
|
|
|
74
|
+ color:['#00A65A', '#F39C12']
|
|
|
75
|
+ };
|
|
|
76
|
+ return option;
|
|
|
77
|
+ }
|
|
|
78
|
+
|
|
|
79
|
+ // pie chart
|
|
|
80
|
+ var pieChart = echarts.init(document.getElementById('pieChart'));
|
|
|
81
|
+ pieChart.setOption(pieChartDate());
|
|
|
82
|
+
|
|
|
83
|
+ function pieChartDate() {
|
|
|
84
|
+ option = {
|
|
|
85
|
+ title : {
|
|
|
86
|
+ text: '调度总次数',
|
|
|
87
|
+ /*subtext: 'subtext',*/
|
|
|
88
|
+ x:'center'
|
|
|
89
|
+ },
|
|
|
90
|
+ tooltip : {
|
|
|
91
|
+ trigger: 'item',
|
|
|
92
|
+ formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
|
93
|
+ },
|
|
|
94
|
+ legend: {
|
|
|
95
|
+ orient: 'vertical',
|
|
|
96
|
+ left: 'left',
|
|
|
97
|
+ data: ['成功调度次数','失败调度次数']
|
|
|
98
|
+ },
|
|
|
99
|
+ series : [
|
|
|
100
|
+ {
|
|
|
101
|
+ name: '访问来源',
|
|
|
102
|
+ type: 'pie',
|
|
|
103
|
+ radius : '55%',
|
|
|
104
|
+ center: ['50%', '60%'],
|
|
|
105
|
+ data:[
|
|
|
106
|
+ {value:800, name:'成功调度次数'},
|
|
|
107
|
+ {value:200, name:'失败调度次数'}
|
|
|
108
|
+ ],
|
|
|
109
|
+ itemStyle: {
|
|
|
110
|
+ emphasis: {
|
|
|
111
|
+ shadowBlur: 10,
|
|
|
112
|
+ shadowOffsetX: 0,
|
|
|
113
|
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
114
|
+ }
|
|
|
115
|
+ }
|
|
|
116
|
+ }
|
|
|
117
|
+ ],
|
|
|
118
|
+ color:['#00A65A', '#F39C12']
|
|
|
119
|
+ };
|
|
|
120
|
+ return option;
|
|
|
121
|
+ }
|
|
|
122
|
+
|
|
|
123
|
+ // 过滤时间
|
|
|
124
|
+ /*$('#filterTime').daterangepicker({
|
|
|
125
|
+ autoApply:false,
|
|
|
126
|
+ singleDatePicker:false,
|
|
|
127
|
+ showDropdowns:false, // 是否显示年月选择条件
|
|
|
128
|
+ timePicker: true, // 是否显示小时和分钟选择条件
|
|
|
129
|
+ timePickerIncrement: 10, // 时间的增量,单位为分钟
|
|
|
130
|
+ timePicker24Hour : true,
|
|
|
131
|
+ opens : 'left', //日期选择框的弹出位置
|
|
|
132
|
+ ranges: {
|
|
|
133
|
+ '最近1小时': [moment().subtract(1, 'hours'), moment()],
|
|
|
134
|
+ '今日': [moment().startOf('day'), moment().endOf('day')],
|
|
|
135
|
+ '昨日': [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')],
|
|
|
136
|
+ '最近7日': [moment().subtract(6, 'days'), moment()],
|
|
|
137
|
+ '最近30日': [moment().subtract(29, 'days'), moment()],
|
|
|
138
|
+ '本月': [moment().startOf('month'), moment().endOf('month')],
|
|
|
139
|
+ '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
|
|
140
|
+ },
|
|
|
141
|
+ locale : {
|
|
|
142
|
+ format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
143
|
+ separator : ' - ',
|
|
|
144
|
+ customRangeLabel : '自定义',
|
|
|
145
|
+ applyLabel : '确定',
|
|
|
146
|
+ cancelLabel : '取消',
|
|
|
147
|
+ fromLabel : '起始时间',
|
|
|
148
|
+ toLabel : '结束时间',
|
|
|
149
|
+ daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
|
|
|
150
|
+ monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月' ],
|
|
|
151
|
+ firstDay : 1,
|
|
|
152
|
+ startDate: moment().startOf('day'),
|
|
|
153
|
+ endDate: moment().endOf('day')
|
|
|
154
|
+ }
|
|
|
155
|
+ });*/
|
|
|
156
|
+
|
|
|
157
|
+});
|