|
@@ -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
|
});
|