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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
| <!DOCTYPE html>
| <!--
| Licensed to the Apache Software Foundation (ASF) under one
| or more contributor license agreements. See the NOTICE file
| distributed with this work for additional information
| regarding copyright ownership. The ASF licenses this file
| to you under the Apache License, Version 2.0 (the
| "License"); you may not use this file except in compliance
| with the License. You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing,
| software distributed under the License is distributed on an
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
| KIND, either express or implied. See the License for the
| specific language governing permissions and limitations
| under the License.
| -->
|
|
| <html>
| <head>
| <meta charset="utf-8">
| <meta name="viewport" content="width=device-width, initial-scale=1" />
| <script src="lib/esl.js"></script>
| <script src="lib/config.js"></script>
| <script src="lib/jquery.min.js"></script>
| <script src="lib/facePrint.js"></script>
| <script src="lib/testHelper.js"></script>
| <!-- <script src="ut/lib/canteen.js"></script> -->
| <link rel="stylesheet" href="lib/reset.css" />
| </head>
| <body>
| <style>
| </style>
|
|
|
| <div id="main0"></div>
| <div id="main1"></div>
| <div id="main2"></div>
| <div id="main3"></div>
| <div id="main4"></div>
| <div id="main5"></div>
| <div id="main6"></div>
|
|
|
|
|
|
|
|
|
| <script>
| require(['echarts'/*, 'map/js/china' */], function (echarts) {
| // $.getJSON('./data/nutrients.json', function (data) {});
|
| var option0 = {
| tooltip: {
| formatter: '{a} <br/>{b} : {c}%'
| },
| toolbox: {
| feature: {
| restore: {},
| saveAsImage: {}
| }
| },
| series: [
| {
| name: '业务指标',
| type: 'gauge',
| pointer: {
| icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z'
| },
| progress: {
| show: true, // 坐标轴线
| },
| data: [
| {value: 20, name: '完成率'}
| ],
| detail: {
| formatter: '{value}%'
| },
| }
| ]
| };
| var chart0 = testHelper.create(echarts, 'main0', {
| title: [
| 'axisLine.roundCap: false, progress.roundCap: false, data.length: 1'
| ],
| option: option0
| });
| setInterval(function () {
| option0.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
| chart0.setOption(option0, true);
| }, 2000);
|
| var option1 = {
| tooltip: {
| formatter: '{a} <br/>{b} : {c}%'
| },
| toolbox: {
| feature: {
| restore: {},
| saveAsImage: {}
| }
| },
| series: [
| {
| name: '业务指标',
| type: 'gauge',
| pointer: {
| icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z'
| },
| progress: {
| show: true, // 坐标轴线
| roundCap: true
| },
| axisLine: {
| roundCap: true
| },
| data: [
| {value: 20, name: '完成率'}
| ],
| detail: {
| formatter: '{value}%'
| },
| }
| ]
| };
| var chart1 = testHelper.create(echarts, 'main1', {
| title: [
| 'axisLine.roundCap: true, progress.roundCap: true, data.length: 1'
| ],
| option: option1
| });
| setInterval(function () {
| option1.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
| chart1.setOption(option1, true);
| }, 2000);
|
|
| var option2 = {
| tooltip: {
| formatter: '{a} <br/>{b} : {c}%'
| },
| toolbox: {
| feature: {
| restore: {},
| saveAsImage: {}
| }
| },
| series: [
| {
| name: '业务指标',
| type: 'gauge',
| pointer: {
| icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z'
| },
| progress: {
| show: true, // 坐标轴线
| overlap: true,
| roundCap: true
| },
| axisLine: {
| roundCap: true
| },
| data: [
| {value: 20, name: '完成率'},
| {value: 40, name: '达标率'},
| {value: 60, name: '优秀率'}
| ],
| title: {
| show: false
| },
| detail: {
| show: false,
| formatter: '{value}%'
| },
| }
| ]
| };
| var chart2 = testHelper.create(echarts, 'main2', {
| title: [
| 'axisLine.roundCap: true, progress.roundCap: true, overlap: true, data.length: 3, detail.show: false'
| ],
| option: option2
| });
| setInterval(function () {
| option2.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
| option2.series[0].data[1].value = (Math.random() * 100).toFixed(2) - 0;
| option2.series[0].data[2].value = (Math.random() * 100).toFixed(2) - 0;
| chart2.setOption(option2, true);
| }, 2000);
|
|
| var option3 = {
| tooltip: {
| formatter: '{a} <br/>{b} : {c}%'
| },
| toolbox: {
| feature: {
| restore: {},
| saveAsImage: {}
| }
| },
| series: [
| {
| name: '业务指标',
| type: 'gauge',
| progress: {
| show: true, // 坐标轴线
| overlap: false,
| roundCap: true
| },
| data: [
| {value: 20, name: '完成率'},
| {value: 40, name: '达标率'},
| {value: 60, name: '优秀率'}
| ],
| title: {
| show: false
| },
| detail: {
| show: false,
| formatter: '{value}%'
| },
| }
| ]
| };
| var chart3 = testHelper.create(echarts, 'main3', {
| title: [
| 'axisLine.roundCap: false, progress.roundCap: true, overlap: false, data.length: 3, detail.show: false'
| ],
| option: option3
| });
| setInterval(function () {
| option3.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
| option3.series[0].data[1].value = (Math.random() * 100).toFixed(2) - 0;
| option3.series[0].data[2].value = (Math.random() * 100).toFixed(2) - 0;
| chart3.setOption(option3, true);
| }, 2000);
|
|
| var option4 = {
| tooltip: {
| formatter: '{a} <br/>{b} : {c}%'
| },
| toolbox: {
| feature: {
| restore: {},
| saveAsImage: {}
| }
| },
| series: [
| {
| name: '业务指标',
| type: 'gauge',
| pointer: {
| icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z'
| },
| progress: {
| show: true, // 坐标轴线
| overlap: false,
| roundCap: true
| },
| axisLine: {
| roundCap: true
| },
| data: [
| {value: 20, name: '完成率'},
| {value: 40, name: '达标率'},
| {value: 60, name: '优秀率'}
| ],
| title: {
| show: false
| },
| detail: {
| show: false,
| formatter: '{value}%'
| },
| }
| ]
| };
| var chart4 = testHelper.create(echarts, 'main4', {
| title: [
| 'axisLine.roundCap: true, progress.roundCap: true, overlap: false, data.length: 3, detail.show: false, title.show: false'
| ],
| option: option4
| });
| setInterval(function () {
| option4.series[0].pointer.show = false;
| option4.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
| option4.series[0].data[1].value = (Math.random() * 100).toFixed(2) - 0;
| option4.series[0].data[2].value = (Math.random() * 100).toFixed(2) - 0;
| chart4.setOption(option4, true);
| }, 2000);
|
|
| var option5 = {
| tooltip: {
| formatter: '{a} <br/>{b} : {c}%'
| },
| toolbox: {
| feature: {
| restore: {},
| saveAsImage: {}
| }
| },
| series: [
| {
| name: '业务指标',
| type: 'gauge',
| startAngle: 90,
| endAngle: -270,
| pointer: {
| show: false
| },
| progress: {
| show: true,
| clip: false,
| roundCap: true,
| itemStyle: {
| color: '#ff9933',
| borderColor: '#7e0023',
| borderWidth: 1
| }
| },
| data: [
| {value: 120, name: '本月跑步'}
| ],
| detail: {
| formatter: '{value} km'
| },
| }
| ]
| };
| var chart5 = testHelper.create(echarts, 'main5', {
| title: [
| 'progress.roundCap: true, click the button to change progress.clip'
| ],
| option: option5,
| buttons: [{text: 'change progress.clip', onclick: function () {
| option5.series[0].progress.clip = !option5.series[0].progress.clip;
| chart5.setOption(option5, true);
| }}]
| });
|
| });
| </script>
|
|
| </body>
| </html>
|
|