Przeglądaj źródła

优劣学科

gzb
guozhongbo 1 rok temu
rodzic
commit
4ef8142ea3
2 zmienionych plików z 126 dodań i 12 usunięć
  1. 96
    1
      js/section_1.js
  2. 30
    11
      sections/section_1.html

+ 96
- 1
js/section_1.js Wyświetl plik

@@ -969,6 +969,100 @@ $(function () {
969 969
       $(".table_num2").html(page[2]);
970 970
     } 
971 971
   }
972
+
973
+  function initgoodbadSubjectEcharts(list) {
974
+    console.log(list);
975
+    var schoolrate = [],
976
+        classrate = [],
977
+        legendlist = [list[0].classname, "全年级"];
978
+      this.subjectscore.forEach((item) => {
979
+        if (item.subjectname != "总分") {
980
+          classrate.push(
981
+            parseInt(
982
+              ((item.classavgscore - item.schoolavgscore) / item.bzc) * 10000
983
+            ) / 100 || 0
984
+          );
985
+          schoolrate.push(
986
+            parseInt((item.classavgscore / item.schoolavgscore) * 10000) / 100 || 0
987
+          );
988
+        }
989
+      });
990
+      // 求出数组最大值
991
+      let arr = [...schoolrate, ...classrate];
992
+      let arr1 = Math.max.apply(null, arr);
993
+      let maxnum = parseInt((arr1 + 10) / 10) * 10;
994
+      let arrList = [];
995
+      for (let i = 0; i < this.subjectscore.length; i++) {
996
+        let item = this.subjectscore[i];
997
+        if (item.subjectname == "总分") {
998
+          continue;
999
+        }
1000
+        let j = {
1001
+          name: item.subjectname,
1002
+          max: maxnum
1003
+        };
1004
+        arrList.push(j);
1005
+      }
1006
+      var option = {
1007
+        animation: false,
1008
+        color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
1009
+        legend: {
1010
+          icon: "rectRound",
1011
+          itemWidth: 6,
1012
+          itemHeight: 6,
1013
+          data: legendlist,
1014
+          x: "center",
1015
+          y: "bottom"
1016
+        },
1017
+        grid: {
1018
+          //直角坐标系内绘图网格
1019
+          left: "3%",
1020
+          right: "3%",
1021
+          bottom: "10%", //grid 组件离容器下侧的距离。
1022
+          containLabel: true //grid 区域是否包含坐标轴的刻度标签。
1023
+        },
1024
+        radar: {
1025
+          radius: "60%",
1026
+          center: ["50%", "55%"],
1027
+          indicator: arrList
1028
+        },
1029
+        series: {
1030
+          type: "radar",
1031
+          tooltip: {
1032
+            trigger: "item"
1033
+          },
1034
+          // areaStyle: {},  //内部阴影
1035
+          data: [
1036
+            {
1037
+              value: classrate,
1038
+              label: {
1039
+                show: true,
1040
+                formatter: function (params) {
1041
+                  return params.value;
1042
+                }
1043
+              },
1044
+              name: this.classname
1045
+            },
1046
+            {
1047
+              value: schoolrate,
1048
+              label: {
1049
+                show: true,
1050
+                formatter: function (params) {
1051
+                  return params.value;
1052
+                }
1053
+              },
1054
+              name: "全年级"
1055
+            }
1056
+          ]
1057
+        }
1058
+    };
1059
+    var myEcharts = echarts.init(
1060
+      document.querySelector(".section1 #goodbadSubjectEcharts")
1061
+    );
1062
+    myEcharts.clear();
1063
+    myEcharts.setOption(option);
1064
+    
1065
+  }
972 1066
   var parameter = JSON.parse($(".section_1_html_root").data("page-params"));
973 1067
   var xAxis_data = [],
974 1068
     html = "";
@@ -1119,5 +1213,6 @@ $(function () {
1119 1213
   initexamaverageEcharts(parameter.xkcj, xAxis_data);
1120 1214
   initscoreGradeEcharts(parameter.fsdjtj, xAxis_data);
1121 1215
   initclassscorePartEcharts(parameter.fsdtj);
1122
-  document.documentElement.scrollTop = 4200;
1216
+  initgoodbadSubjectEcharts(parameter.xkcj);
1217
+  document.documentElement.scrollTop = 6200;
1123 1218
 });

+ 30
- 11
sections/section_1.html Wyświetl plik

@@ -142,20 +142,39 @@
142 142
       <div class="gradescale"></div>
143 143
     </div>
144 144
     <div class="page_root section1 table_num0">
145
-      <div>
146
-        <h2 class="section_title_2">4.分数段统计</h2>
147
-        <h3 class="section_title_3">4.1 各科分数段分析</h3>
148
-        <div class="curscorelevel">
149
-          当前设置分数段:<span class="classPartEcharts">20</span>分/段
145
+      <h2 class="section_title_2">4.分数段统计</h2>
146
+      <h3 class="section_title_3">4.1 各科分数段分析</h3>
147
+      <div class="curscorelevel">
148
+        当前设置分数段:<span class="classPartEcharts">20</span>分/段
149
+      </div>
150
+      <div
151
+        id="classscorePartEcharts"
152
+        style="margin: 0 4mm 4mm; height: 80mm"
153
+      ></div>
154
+      <h3 class="section_title_3">4.2 各科分数段比例分布</h3>
155
+      <div class="scoredistribution"></div>
156
+    </div>
157
+    <div class="page_root section1">
158
+      <h2 class="section_title_2">5.优劣学科统计</h2>
159
+      <h3 class="section_title_3">5.1 各科优劣分析</h3>
160
+      <div
161
+        id="goodbadSubjectEcharts"
162
+        style="margin: 0 4mm 4mm; height: 80mm"
163
+      ></div>
164
+      <div class="echarts_result">
165
+        <div>上图统计结果表示:</div>
166
+        <div class="echarts_result_content">
167
+          <span class="yj" style="background-color: #5c99ff"></span
168
+          >优势学科:<span class="goodsubject"></span>
150 169
         </div>
151 170
         <div
152
-          id="classscorePartEcharts"
153
-          style="margin: 0 4mm 4mm; height: 80mm"
154
-        ></div>
155
-        <h3 class="section_title_3">4.2 各科分数段比例分布</h3>
171
+          class="echarts_result_content"
172
+          style="margin-top: 0; padding-top: 0"
173
+        >
174
+          <span class="yj" style="background-color: #ff5f56"></span
175
+          >劣势学科<span class="badsubject"></span>
176
+        </div>
156 177
       </div>
157
-
158
-      <div class="scoredistribution"></div>
159 178
     </div>
160 179
     <script src="../js/section_1.js"></script>
161 180
   </body>

Ładowanie…
Anuluj
Zapisz