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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
| <template>
| <div class="publicToilets">
| <div class="header">
| <span class="title1">事件处理结果总览</span>
| </div>
| <div class="echartsTool">
| <chart :optionIn="option1" />
| </div>
| </div>
| </template>
|
| <script>
| import * as echarts from 'echarts';
| import chart from "@/components/chart.vue";
| export default {
| name: "EventsHandle",
| data() {
| return {
| option1: {}
| }
| },
| components: {
| chart
| },
| mounted() {
| var legendData = ['总事件', '已处理事件数']; //图例
| var indicator = [{
| text: '大雁塔',
| max: 100,
| },
| {
| text: '大唐芙蓉园',
| max: 100
| },
| {
| text: '钟鼓楼',
| max: 100
| },
| {
| text: '小寨商业区',
| max: 100,
| },
| {
| text: '浐灞',
| max: 100
| },
| {
| text: '回民街',
| max: 100
| },
| {
| text: '南城门',
| max: 100
| },
| {
| text: '北大街',
| max: 100
| },
| ];
| var scores = [
| {
| name: '进站',
| value: [43, 79, 83, 43, 36, 67, 43, 35],
| },
| {
| name: '出站',
| value: [37, 72, 41, 31, 23, 61, 37, 27],
| },
| ];
| var dataArr = [{
| value: [43, 79, 83, 43, 36, 67, 43, 35],
| name: legendData[0],
| itemStyle: {
| normal: {
| lineStyle: {
| color: '#4A99FF',
| // shadowColor: '#4A99FF',
| // shadowBlur: 10,
| },
| shadowColor: '#4A99FF',
| shadowBlur: 10,
| },
| },
| areaStyle: {
| normal: { // 单项区域填充样式
| color: {
| type: 'linear',
| x: 0, //右
| y: 0, //下
| x2: 1, //左
| y2: 1, //上
| colorStops: [{
| offset: 0,
| color: '#4A99FF'
| }, {
| offset: 0.5,
| color: 'rgba(0,0,0,0)'
| }, {
| offset: 1,
| color: '#4A99FF'
| }],
| globalCoord: false
| },
| opacity: 1 // 区域透明度
| }
| }
| },
| {
| value: [37, 72, 41, 31, 23, 61, 37, 27],
| name: legendData[1],
| itemStyle: {
| normal: {
| lineStyle: {
| color: '#4BFFFC',
| // shadowColor: '#4BFFFC',
| // shadowBlur: 10,
| },
| shadowColor: '#4BFFFC',
| shadowBlur: 10,
| },
| },
| areaStyle: {
| normal: { // 单项区域填充样式
| color: {
| type: 'linear',
| x: 0, //右
| y: 0, //下
| x2: 1, //左
| y2: 1, //上
| colorStops: [{
| offset: 0,
| color: '#4BFFFC'
| }, {
| offset: 0.5,
| color: 'rgba(0,0,0,0)'
| }, {
| offset: 1,
| color: '#4BFFFC'
| }],
| globalCoord: false
| },
| opacity: 1 // 区域透明度
| }
| }
| }
| ];
| let i = -1
| var colorArr = ['#4A99FF', '#4BFFFC']; //颜色
| this.option1 = {
| // backgroundColor: '#013A54',
| color: colorArr,
| grid: {
| left: '0px',
| right: '0px',
| bottom: '0px',
| top: '0px',
| //是否包含坐标轴
| containLabel: true,
| //鼠标滑过是否显示信息栏,目前来看最好在grid中配置tooltip鼠标滑过信息栏
| },
| legend: {
| orient: 'horizontal',
| icon: 'circle', //图例形状
| data: legendData,
| top: '-3px',
| // right:10,
| itemWidth: 12, // 图例标记的图形宽度。[ default: 25 ]
| itemHeight: 12, // 图例标记的图形高度。[ default: 14 ]
| itemGap: 12, // 图例每项之间的间隔。[ default: 10 ]横向布局时为水平间隔,纵向布局时为纵向间隔。
| textStyle: {
| fontSize: 12,
| color: '#00E4FF',
| },
| },
| radar: {
| // shape: 'circle',
| name: {
| // textStyle: {
| // color: '#fff',
| // fontSize: 16
| // },
| rich: {
| a: {
| fontSize: 12,
| color: '#fff',
| lineHeight: '40',
| padding: [0, 0, 0, 0],
| },
| b: {
| color: '#77bbFF',
| fontSize: 12,
| padding: [0, 0, 0, 0],
| },
| c: {
| color: '#fff',
| fontSize: 12,
| },
| d: {
| color: '#4BFFFC',
| fontSize: 12,
| padding: [0, 0, 0, 0],
| },
| triggerEvent: true,
| },
| formatter: (a) => {
| // 处理对应要显示的样式
| i++
| return `{a| ${a}:}{b| ${scores[0]['value'][i]}}{c| / }{d| ${scores[1]['value'][i]}}`;
|
| },
| },
| radius: '55%',
| center: ['50%', '52%'],
| indicator: indicator,
| splitArea: { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
| show: true,
| areaStyle: { // 分隔区域的样式设置。
| color: ['rgba(255,255,255,0)', 'rgba(255,255,255,0)'], // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
| }
| },
| axisLine: { //指向外圈文本的分隔线样式
| lineStyle: {
| color: '#1D6B86'
| }
| },
| splitLine: {
| lineStyle: {
| color: '#1D6B86', // 分隔线颜色
| width: 1, // 分隔线线宽
| }
| },
| },
| series: [{
| type: 'radar',
| symbolSize: 8,
| // symbol: 'angle',
| data: dataArr
| }]
| };
| },
| }
|
|
|
| </script>
|
| <style lang="scss" scoped>
| .publicToilets {
| width: 100%;
| height: 33%;
| display: flex;
| flex-direction: column;
| align-items: center;
|
| .echartsTool {
| width: calc(100% - 40px);
| height: 100%;
| margin-top: 20px;
| }
|
| .header {
| width: 304px;
| height: 27.5px;
| margin-left: 20px;
| margin-top: 20px;
| background-image: url("~@/assets/img/menuTitle1.png");
| background-repeat: no-repeat;
| background-size: 100% 100%;
| font-family: PangMenZhengDao;
| text-shadow: 0px 6px 9px #20618e;
| display: flex;
| flex-direction: row;
| align-items: center;
| flex-shrink: 0;
| align-self: flex-start;
|
| .title1 {
| margin-left: 30px;
| font-size: 15px;
| color: #ffffff;
| }
| }
| }
| </style>
|
|