Browse Source

Merge remote-tracking branch 'origin/gzb' into wzl

wzl_h
wangzhonglu 2 years ago
parent
commit
88333e3567
1 changed files with 71 additions and 56 deletions
  1. 71
    56
      js/section_1.js

+ 71
- 56
js/section_1.js View File

@@ -1,4 +1,4 @@
1
-function initaveragescoreEcharts() {
1
+function initAverageScoreEcharts() {
2 2
   var itemStyle = {
3 3
     normal: {
4 4
       label: {
@@ -12,8 +12,9 @@ function initaveragescoreEcharts() {
12 12
   var curseries = [{
13 13
       name: "满分",
14 14
       type: "bar",
15
-      barWidth: 32,
16
-      barMinHeight: 16,
15
+      barWidth: $.UnitUtil.mm2px(5),
16
+      // 柱状图最小高度
17
+      barMinHeight: $.UnitUtil.mm2px(2),
17 18
       barGap: 0,
18 19
       data: [60, 70],
19 20
       itemStyle
@@ -21,8 +22,9 @@ function initaveragescoreEcharts() {
21 22
     {
22 23
       name: "最高分",
23 24
       type: "bar",
24
-      barWidth: 32,
25
-      barMinHeight: 16,
25
+      barWidth: $.UnitUtil.mm2px(5),
26
+      // 柱状图最小高度
27
+      barMinHeight: $.UnitUtil.mm2px(2),
26 28
       barGap: 0,
27 29
       data: [50, 60],
28 30
       itemStyle
@@ -30,8 +32,9 @@ function initaveragescoreEcharts() {
30 32
     {
31 33
       name: "最低分",
32 34
       type: "bar",
33
-      barWidth: 32,
34
-      barMinHeight: 16,
35
+      barWidth: $.UnitUtil.mm2px(5),
36
+      // 柱状图最小高度
37
+      barMinHeight: $.UnitUtil.mm2px(2),
35 38
       barGap: 0,
36 39
       data: [30, 40],
37 40
       itemStyle
@@ -39,14 +42,16 @@ function initaveragescoreEcharts() {
39 42
     {
40 43
       name: "平均分",
41 44
       type: "bar",
42
-      barWidth: 32,
43
-      barMinHeight: 16,
45
+      barWidth: $.UnitUtil.mm2px(5),
46
+      // 柱状图最小高度
47
+      barMinHeight: $.UnitUtil.mm2px(2),
44 48
       barGap: 0,
45 49
       data: [40, 50],
46 50
       itemStyle
47 51
     }
48 52
   ];
49 53
   let option = {
54
+    animation: false,
50 55
     color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
51 56
     title: {
52 57
       text: "分",
@@ -54,22 +59,22 @@ function initaveragescoreEcharts() {
54 59
       y: "top",
55 60
       textStyle: {
56 61
         color: "#5F6E82",
57
-        fontSize: 12,
62
+        fontSize: $.UnitUtil.mm2px(3),
58 63
         fontWeight: 500
59 64
       }
60 65
     },
61 66
     legend: {
62
-      itemWidth: 6,
63
-      itemHeight: 6,
67
+      itemWidth: $.UnitUtil.mm2px(2),
68
+      itemHeight: $.UnitUtil.mm2px(2),
64 69
       top: "bottom",
65 70
       data: curlegend
66 71
     },
67 72
     grid: {
68
-      top: 30,
69
-      left: 5,
73
+      top: $.UnitUtil.mm2px(10),
74
+      left: 0,
70 75
       right: 0,
71
-      bottom: "10%",
72
-      containLabel: true
76
+      bottom: $.UnitUtil.mm2px(8),
77
+      containLabel: true,
73 78
     },
74 79
     xAxis: [{
75 80
       type: "category",
@@ -118,7 +123,7 @@ function initaveragescoreEcharts() {
118 123
   myEcharts.setOption(option);
119 124
 }
120 125
 
121
-function initexcellencerateEcharts() {
126
+function initExcellenceRateEcharts() {
122 127
   var itemStyle = {
123 128
     normal: {
124 129
       label: {
@@ -132,8 +137,9 @@ function initexcellencerateEcharts() {
132 137
   var curseries = [{
133 138
       name: "优秀率",
134 139
       type: "bar",
135
-      barWidth: 32,
136
-      barMinHeight: 16,
140
+      barWidth: $.UnitUtil.mm2px(5),
141
+      // 柱状图最小高度
142
+      barMinHeight: $.UnitUtil.mm2px(2),
137 143
       barGap: 0,
138 144
       data: [60, 70],
139 145
       itemStyle
@@ -141,8 +147,9 @@ function initexcellencerateEcharts() {
141 147
     {
142 148
       name: "良好率",
143 149
       type: "bar",
144
-      barWidth: 32,
145
-      barMinHeight: 16,
150
+      barWidth: $.UnitUtil.mm2px(5),
151
+      // 柱状图最小高度
152
+      barMinHeight: $.UnitUtil.mm2px(2),
146 153
       barGap: 0,
147 154
       data: [50, 60],
148 155
       itemStyle
@@ -150,8 +157,9 @@ function initexcellencerateEcharts() {
150 157
     {
151 158
       name: "及格率",
152 159
       type: "bar",
153
-      barWidth: 32,
154
-      barMinHeight: 16,
160
+      barWidth: $.UnitUtil.mm2px(5),
161
+      // 柱状图最小高度
162
+      barMinHeight: $.UnitUtil.mm2px(2),
155 163
       barGap: 0,
156 164
       data: [30, 40],
157 165
       itemStyle
@@ -159,14 +167,16 @@ function initexcellencerateEcharts() {
159 167
     {
160 168
       name: "低分率",
161 169
       type: "bar",
162
-      barWidth: 32,
163
-      barMinHeight: 16,
170
+      barWidth: $.UnitUtil.mm2px(5),
171
+      // 柱状图最小高度
172
+      barMinHeight: $.UnitUtil.mm2px(2),
164 173
       barGap: 0,
165 174
       data: [40, 50],
166 175
       itemStyle
167 176
     }
168 177
   ];
169 178
   let option = {
179
+    animation: false,
170 180
     color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
171 181
     title: {
172 182
       text: "分",
@@ -174,22 +184,22 @@ function initexcellencerateEcharts() {
174 184
       y: "top",
175 185
       textStyle: {
176 186
         color: "#5F6E82",
177
-        fontSize: 12,
187
+        fontSize: $.UnitUtil.mm2px(3),
178 188
         fontWeight: 500
179 189
       }
180 190
     },
181 191
     legend: {
182
-      itemWidth: 6,
183
-      itemHeight: 6,
192
+      itemWidth: $.UnitUtil.mm2px(2),
193
+      itemHeight: $.UnitUtil.mm2px(2),
184 194
       top: "bottom",
185 195
       data: curlegend
186 196
     },
187 197
     grid: {
188
-      top: 30,
189
-      left: 5,
198
+      top: $.UnitUtil.mm2px(10),
199
+      left: 0,
190 200
       right: 0,
191
-      bottom: "10%",
192
-      containLabel: true
201
+      bottom: $.UnitUtil.mm2px(8),
202
+      containLabel: true,
193 203
     },
194 204
     xAxis: [{
195 205
       type: "category",
@@ -238,7 +248,7 @@ function initexcellencerateEcharts() {
238 248
   myEcharts.setOption(option);
239 249
 }
240 250
 
241
-function initexamnumEcharts() {
251
+function initExamnumEcharts() {
242 252
   var itemStyle = {
243 253
     normal: {
244 254
       label: {
@@ -252,8 +262,9 @@ function initexamnumEcharts() {
252 262
   var curseries = [{
253 263
       name: "实考人数",
254 264
       type: "bar",
255
-      barWidth: 32,
256
-      barMinHeight: 16,
265
+      barWidth: $.UnitUtil.mm2px(5),
266
+      // 柱状图最小高度
267
+      barMinHeight: $.UnitUtil.mm2px(2),
257 268
       barGap: 0,
258 269
       data: [60, 70],
259 270
       itemStyle
@@ -261,14 +272,16 @@ function initexamnumEcharts() {
261 272
     {
262 273
       name: "缺考人数",
263 274
       type: "bar",
264
-      barWidth: 32,
265
-      barMinHeight: 16,
275
+      barWidth: $.UnitUtil.mm2px(5),
276
+      // 柱状图最小高度
277
+      barMinHeight: $.UnitUtil.mm2px(2),
266 278
       barGap: 0,
267 279
       data: [50, 60],
268 280
       itemStyle
269 281
     }
270 282
   ];
271 283
   let option = {
284
+    animation: false,
272 285
     color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
273 286
     title: {
274 287
       text: "分",
@@ -276,22 +289,22 @@ function initexamnumEcharts() {
276 289
       y: "top",
277 290
       textStyle: {
278 291
         color: "#5F6E82",
279
-        fontSize: 12,
292
+        fontSize: $.UnitUtil.mm2px(3),
280 293
         fontWeight: 500
281 294
       }
282 295
     },
283 296
     legend: {
284
-      itemWidth: 6,
285
-      itemHeight: 6,
297
+      itemWidth: $.UnitUtil.mm2px(2),
298
+      itemHeight: $.UnitUtil.mm2px(2),
286 299
       top: "bottom",
287 300
       data: curlegend
288 301
     },
289 302
     grid: {
290
-      top: 30,
291
-      left: 5,
303
+      top: $.UnitUtil.mm2px(10),
304
+      left: 0,
292 305
       right: 0,
293
-      bottom: "10%",
294
-      containLabel: true
306
+      bottom: $.UnitUtil.mm2px(8),
307
+      containLabel: true,
295 308
     },
296 309
     xAxis: [{
297 310
       type: "category",
@@ -354,13 +367,15 @@ function initbzcEcharts() {
354 367
   var curseries = [{
355 368
     name: "标准差",
356 369
     type: "bar",
357
-    barWidth: 32,
358
-    barMinHeight: 16,
370
+    barWidth: $.UnitUtil.mm2px(5),
371
+    // 柱状图最小高度
372
+    barMinHeight: $.UnitUtil.mm2px(2),
359 373
     barGap: 0,
360 374
     data: [60, 70],
361 375
     itemStyle
362 376
   }];
363 377
   let option = {
378
+    animation: false,
364 379
     color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
365 380
     title: {
366 381
       text: "分",
@@ -368,22 +383,22 @@ function initbzcEcharts() {
368 383
       y: "top",
369 384
       textStyle: {
370 385
         color: "#5F6E82",
371
-        fontSize: 12,
386
+        fontSize: $.UnitUtil.mm2px(3),
372 387
         fontWeight: 500
373 388
       }
374 389
     },
375 390
     legend: {
376
-      itemWidth: 6,
377
-      itemHeight: 6,
391
+      itemWidth: $.UnitUtil.mm2px(2),
392
+      itemHeight: $.UnitUtil.mm2px(2),
378 393
       top: "bottom",
379 394
       data: curlegend
380 395
     },
381 396
     grid: {
382
-      top: 30,
383
-      left: 5,
397
+      top: $.UnitUtil.mm2px(10),
398
+      left: 0,
384 399
       right: 0,
385
-      bottom: "10%",
386
-      containLabel: true
400
+      bottom: $.UnitUtil.mm2px(8),
401
+      containLabel: true,
387 402
     },
388 403
     xAxis: [{
389 404
       type: "category",
@@ -435,8 +450,8 @@ $(function () {
435 450
   // outerHeight(true) 高度为 height+margin+padding+border
436 451
   var parameter = $(".section_1_html_root").data("page-params");
437 452
   console.log("section_1:parameter", parameter);
438
-  initaveragescoreEcharts();
439
-  initexcellencerateEcharts();
440
-  initexamnumEcharts();
453
+  initAverageScoreEcharts();
454
+  initExcellenceRateEcharts();
455
+  initExamnumEcharts();
441 456
   initbzcEcharts();
442 457
 });

Loading…
Cancel
Save