12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265 |
- $(function () {
- function initAverageScoreEcharts(list, xAxis_data) {
- var itemStyle = {
- normal: {
- label: {
- show: true, //开启显示数值
- position: "top" //数值在上方显示
- }
- }
- };
- var score = [],
- maxscore = [],
- minscore = [],
- avgscore = [];
- var curlegend = ["满分", "最高分", "最低分", "平均分"];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- score.push(item.allscore);
- maxscore.push(item.classmaxscore);
- minscore.push(item.classminscore);
- avgscore.push(item.classavgscore);
- }
- var curseries = [
- {
- name: "满分",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: score,
- itemStyle: itemStyle
- },
- {
- name: "最高分",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: maxscore,
- itemStyle: itemStyle
- },
- {
- name: "最低分",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: minscore,
- itemStyle: itemStyle
- },
- {
- name: "平均分",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: avgscore,
- itemStyle: itemStyle
- }
- ];
- var option = {
- animation: false,
- color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
- title: {
- text: "分",
- x: "left",
- y: "top",
- textStyle: {
- color: "#5F6E82",
- fontSize: $.UnitUtil.mm2px(3),
- fontWeight: 500
- }
- },
- legend: {
- itemWidth: $.UnitUtil.mm2px(2),
- itemHeight: $.UnitUtil.mm2px(2),
- top: "bottom",
- data: curlegend
- },
- grid: {
- top: $.UnitUtil.mm2px(10),
- left: 0,
- right: 0,
- bottom: $.UnitUtil.mm2px(8),
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
- data: xAxis_data,
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- },
- axisTick: {
- alignWithLabel: true
- },
- boundaryGap: true,
- triggerEvent: true,
- axisLine: {
- show: true, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- axisTick: {
- show: false //刻度
- },
- axisLine: {
- show: false, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- },
- splitLine: {
- //网格线
- lineStyle: {
- type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
- },
- show: true //隐藏或显示
- },
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- }
- }
- ],
- series: curseries
- };
- var myEcharts = echarts.init(
- document.querySelector(".section1 #averagescoreEcharts")
- );
- myEcharts.clear();
- myEcharts.setOption(option);
- }
-
- function initExcellenceRateEcharts(list, xAxis_data) {
- var itemStyle = {
- normal: {
- label: {
- show: true, //开启显示数值
- position: "top" //数值在上方显示
- }
- }
- };
- var yxrate = [],
- lhrate = [],
- jgrate = [],
- dfrate = [];
- var curlegend = ["优秀率", "良好率", "及格率", "低分率"];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- yxrate.push(item.yxrate);
- lhrate.push(item.lhrate);
- jgrate.push(item.jgrate);
- dfrate.push(item.dfrate);
- }
- var curseries = [
- {
- name: "优秀率",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: yxrate,
- itemStyle: itemStyle
- },
- {
- name: "良好率",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: lhrate,
- itemStyle: itemStyle
- },
- {
- name: "及格率",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: jgrate,
- itemStyle: itemStyle
- },
- {
- name: "低分率",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: dfrate,
- itemStyle: itemStyle
- }
- ];
- var option = {
- animation: false,
- color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
- title: {
- text: "分",
- x: "left",
- y: "top",
- textStyle: {
- color: "#5F6E82",
- fontSize: $.UnitUtil.mm2px(3),
- fontWeight: 500
- }
- },
- legend: {
- itemWidth: $.UnitUtil.mm2px(2),
- itemHeight: $.UnitUtil.mm2px(2),
- top: "bottom",
- data: curlegend
- },
- grid: {
- top: $.UnitUtil.mm2px(10),
- left: 0,
- right: 0,
- bottom: $.UnitUtil.mm2px(8),
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
- data: xAxis_data,
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- },
- axisTick: {
- alignWithLabel: true
- },
- boundaryGap: true,
- triggerEvent: true,
- axisLine: {
- show: true, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- axisTick: {
- show: false //刻度
- },
- axisLine: {
- show: false, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- },
- splitLine: {
- //网格线
- lineStyle: {
- type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
- },
- show: true //隐藏或显示
- },
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- }
- }
- ],
- series: curseries
- };
- var myEcharts = echarts.init(
- document.querySelector(".section1 #excellencerateEcharts")
- );
- myEcharts.clear();
- myEcharts.setOption(option);
- }
-
- function initExamnumEcharts(list, xAxis_data) {
- var itemStyle = {
- normal: {
- label: {
- show: true, //开启显示数值
- position: "top" //数值在上方显示
- }
- }
- };
- var stunum = [],
- missnum = [];
- var curlegend = ["实考人数", "缺考人数"];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- stunum.push(item.stunum);
- missnum.push(item.missnum);
- }
- var curseries = [
- {
- name: "实考人数",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: stunum,
- itemStyle: itemStyle
- },
- {
- name: "缺考人数",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: missnum,
- itemStyle: itemStyle
- }
- ];
- var option = {
- animation: false,
- color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
- title: {
- text: "分",
- x: "left",
- y: "top",
- textStyle: {
- color: "#5F6E82",
- fontSize: $.UnitUtil.mm2px(3),
- fontWeight: 500
- }
- },
- legend: {
- itemWidth: $.UnitUtil.mm2px(2),
- itemHeight: $.UnitUtil.mm2px(2),
- top: "bottom",
- data: curlegend
- },
- grid: {
- top: $.UnitUtil.mm2px(10),
- left: 0,
- right: 0,
- bottom: $.UnitUtil.mm2px(8),
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
- data: xAxis_data,
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- },
- axisTick: {
- alignWithLabel: true
- },
- boundaryGap: true,
- triggerEvent: true,
- axisLine: {
- show: true, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- axisTick: {
- show: false //刻度
- },
- axisLine: {
- show: false, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- },
- splitLine: {
- //网格线
- lineStyle: {
- type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
- },
- show: true //隐藏或显示
- },
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- }
- }
- ],
- series: curseries
- };
- var myEcharts = echarts.init(
- document.querySelector(".section1 #examnumEcharts")
- );
- myEcharts.clear();
- myEcharts.setOption(option);
- }
-
- function initbzcEcharts(list, xAxis_data) {
- var itemStyle = {
- normal: {
- label: {
- show: true, //开启显示数值
- position: "top" //数值在上方显示
- }
- }
- };
- var bzc = [];
- var curlegend = ["标准差"];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- bzc.push(item.bzc);
- }
- var curseries = [
- {
- name: "标准差",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: bzc,
- itemStyle: itemStyle
- }
- ];
- var option = {
- animation: false,
- color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
- title: {
- text: "分",
- x: "left",
- y: "top",
- textStyle: {
- color: "#5F6E82",
- fontSize: $.UnitUtil.mm2px(3),
- fontWeight: 500
- }
- },
- legend: {
- itemWidth: $.UnitUtil.mm2px(2),
- itemHeight: $.UnitUtil.mm2px(2),
- top: "bottom",
- data: curlegend
- },
- grid: {
- top: $.UnitUtil.mm2px(10),
- left: 0,
- right: 0,
- bottom: $.UnitUtil.mm2px(8),
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
- data: xAxis_data,
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- },
- axisTick: {
- alignWithLabel: true
- },
- boundaryGap: true,
- triggerEvent: true,
- axisLine: {
- show: true, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- axisTick: {
- show: false //刻度
- },
- axisLine: {
- show: false, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- },
- splitLine: {
- //网格线
- lineStyle: {
- type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
- },
- show: true //隐藏或显示
- },
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- }
- }
- ],
- series: curseries
- };
- var myEcharts = echarts.init(
- document.querySelector(".section1 #bzcEcharts")
- );
- myEcharts.clear();
- myEcharts.setOption(option);
- }
-
- function initexamaverageEcharts(list, xAxis_data) {
- var itemStyle = {
- normal: {
- label: {
- show: true, //开启显示数值
- position: "top" //数值在上方显示
- }
- }
- };
- var stunum = [],
- missnum = [];
- var curlegend = ["平均分", "校平均分"];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- stunum.push(item.classavgscore);
- missnum.push(item.schoolavgscore);
- }
- var curseries = [
- {
- name: "平均分",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: stunum,
- itemStyle: itemStyle
- },
- {
- name: "校平均分",
- type: "bar",
- barWidth: $.UnitUtil.mm2px(5),
- // 柱状图最小高度
- barMinHeight: $.UnitUtil.mm2px(2),
- barGap: 0,
- data: missnum,
- itemStyle: itemStyle
- }
- ];
- var option = {
- animation: false,
- color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
- title: {
- text: "分",
- x: "left",
- y: "top",
- textStyle: {
- color: "#5F6E82",
- fontSize: $.UnitUtil.mm2px(3),
- fontWeight: 500
- }
- },
- legend: {
- itemWidth: $.UnitUtil.mm2px(2),
- itemHeight: $.UnitUtil.mm2px(2),
- top: "bottom",
- data: curlegend
- },
- grid: {
- top: $.UnitUtil.mm2px(10),
- left: 0,
- right: 0,
- bottom: $.UnitUtil.mm2px(8),
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
- data: xAxis_data,
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- },
- axisTick: {
- alignWithLabel: true
- },
- boundaryGap: true,
- triggerEvent: true,
- axisLine: {
- show: true, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- axisTick: {
- show: false //刻度
- },
- axisLine: {
- show: false, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- },
- splitLine: {
- //网格线
- lineStyle: {
- type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
- },
- show: true //隐藏或显示
- },
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- }
- }
- ],
- series: curseries
- };
- var myEcharts = echarts.init(
- document.querySelector(".section1 #examaverageEcharts")
- );
- myEcharts.clear();
- myEcharts.setOption(option);
- }
-
- function initscoreGradeEcharts(list) {
- var xAxis_data = [],
- series_data = [],
- legend_data = [],
- levelRateObj = {},
- levelNumObj = {},
- levelrangeObj = [];
- $.each(list, function (key, item) {
- if (item.subjectname == "总分") {
- item.subjectname = "全科";
- }
- if ($.inArray(item.subjectname, xAxis_data) == -1) {
- xAxis_data.push(item.subjectname);
- }
- if ($.inArray(item.rankname + "类", legend_data) == -1) {
- legend_data.push(item.rankname + "类");
- }
- if ($.inArray(item.rankrange, levelrangeObj) == -1) {
- levelrangeObj.push(item.rankrange);
- }
- if (!levelRateObj[item.rankname + "类"]) {
- levelRateObj[item.rankname + "类"] = [];
- }
- levelRateObj[item.rankname + "类"].push(item.sturate);
- if (!levelNumObj[item.rankname + "类"]) {
- levelNumObj[item.rankname + "类"] = [];
- }
- levelNumObj[item.rankname + "类"].push(item.stunum);
- });
- $.each(legend_data, function (key, item) {
- series_data.push({
- name: item,
- type: "bar",
- stack: "总量",
- barWidth: 32,
- // 柱状图最小高度
- barMinHeight: 16,
- showBackground: true, // 柱状图显示背景
- backgroundStyle: {
- color: "#F3F4F5"
- },
- itemStyle: {
- normal: {
- barBorderRadius: [4, 4, 4, 4]
- }
- },
- label: {
- normal: {
- show: true,
- align: "center",
- verticalAlign: "middle",
- position: "inside",
- distance: 0,
- color: "#fff",
- formatter: function (params) {
- return levelNumObj[params.seriesName][params.dataIndex] || 0;
- }
- }
- },
- data: levelNumObj[item]
- });
- });
- showgraphicaldata(xAxis_data, legend_data, levelrangeObj, list);
- var option = {
- color: ["#5C99FF", "#ff5f56", "#5EC5C8", "#f1982b", "#6e5eff"],
- animation: false,
- title: {
- text: "%",
- x: "left",
- y: "top",
- textStyle: {
- color: "#5F6E82",
- fontSize: $.UnitUtil.mm2px(3),
- fontWeight: 500
- }
- },
- legend: {
- itemWidth: $.UnitUtil.mm2px(2),
- itemHeight: $.UnitUtil.mm2px(2),
- top: "bottom",
- data: legend_data
- },
- grid: {
- top: $.UnitUtil.mm2px(10),
- left: 0,
- right: 0,
- bottom: $.UnitUtil.mm2px(8),
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
- data: xAxis_data,
- axisLabel: {
- color: "#5F6E82", //更改坐标轴文字颜色
- interval: 0
- },
- axisTick: {
- alignWithLabel: true
- },
- boundaryGap: true,
- triggerEvent: true,
- axisLine: {
- show: true, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- axisTick: {
- show: false //刻度
- },
- axisLine: {
- show: false, //是否显示轴线
- lineStyle: {
- color: "#DADADA" //刻度线的颜色
- }
- },
- splitLine: {
- //网格线
- lineStyle: {
- type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
- },
- show: true //隐藏或显示
- },
- axisLabel: {
- color: "#5F6E82" //更改坐标轴文字颜色
- }
- }
- ],
- series: series_data
- };
- var myEcharts = echarts.init(
- document.querySelector(".section1 #scoreGradeEcharts")
- );
- myEcharts.clear();
- myEcharts.setOption(option);
- }
- //图表数据
- function showgraphicaldata(xAxis_data, legend_data, levelrangeObj, list) {
- //图表数据
- var arr = JSON.parse(JSON.stringify(list));
- var tableobj = {};
- var tablehtml = "";
- $.each(xAxis_data, function (idx, item) {
- var classs = $.grep(arr, function (val) {
- return val.subjectname == item;
- });
- tableobj[classs[0].subjectname + "goodTableHeadTr1Html"] =
- '<th rowspan="2">科目</th>';
- tableobj[classs[0].subjectname + "goodTableHeadTr2Html"] = "";
- tableobj[classs[0].subjectname + "goodTableTbodyHtml"] = "";
- $.each(classs, function (idx, item) {
- tableobj[item.subjectname + "goodTableHeadTr1Html"] +=
- '<th colspan="2">' + item.rankname + "类" + item.rankrange + "</th>";
- tableobj[item.subjectname + "goodTableHeadTr2Html"] +=
- "<th>人数</th><th>比例</th>";
- if (idx == 0) {
- tableobj[item.subjectname + "goodTableTbodyHtml"] +=
- '<td><div class="my_cell">' + item.subjectname + "</div></td>";
- }
- tableobj[item.subjectname + "goodTableTbodyHtml"] +=
- '<td><div class="my_cell">' +
- item.stunum +
- '</div></td><td><div class="my_cell">' +
- item.sturate +
- "%</div></td>";
- });
- tablehtml +=
- ' <table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
- tableobj[classs[0].subjectname + "goodTableHeadTr1Html"] +
- '</tr><tr class="goodTableHeadTr2">' +
- tableobj[classs[0].subjectname + "goodTableHeadTr2Html"] +
- '</tr></thead><tbody class="goodTableTbody">' +
- tableobj[classs[0].subjectname + "goodTableTbodyHtml"] +
- "</tbody></table>";
- });
- $(".section1 .gradescale").html(tablehtml);
- }
-
- function initclassscorePartEcharts(list) {
- var xAxis_data = [];
- var dataArr = [];
- var arr = $.grep(list, function (val) {
- return val.subjectid == "zf";
- });
- $.each(arr, function (index, item) {
- xAxis_data.push(item.rankname);
- dataArr.push(item.stunum);
- });
- var series_data = [
- {
- name: "全科",
- type: "line",
- symbol: "circle",
- stack: "全科",
- label: {
- normal: {
- show: true,
- align: "center",
- verticalAlign: "bottom",
- position: "top",
- distance: 0,
- formatter: `{c}`
- }
- },
- data: dataArr
- }
- ];
- var option = {
- animation: false,
- title: {
- text: "人",
- x: "left",
- y: "top",
- textStyle: {
- color: "#5F6E82",
- fontSize: $.UnitUtil.mm2px(3),
- fontWeight: 500
- }
- },
- color: ["#5C99FF", "#ff5f56", "#5EC5C8", "#f1982b", "#6e5eff"],
- legend: {
- icon: "roundRect",
- itemWidth: $.UnitUtil.mm2px(2),
- itemHeight: $.UnitUtil.mm2px(2),
- top: "bottom",
- data: ["全科"]
- },
- grid: {
- top: $.UnitUtil.mm2px(10),
- left: 0,
- right: 0,
- bottom: $.UnitUtil.mm2px(8),
- containLabel: true
- },
- xAxis: {
- type: "category",
- axisLabel: {
- textStyle: {
- color: "#5F6E82"
- },
- interval: 2,
- rotate: 0
- },
- axisTick: {
- show: false
- },
- data: xAxis_data
- },
- yAxis: {
- axisLabel: {
- textStyle: {
- color: "#9B9B9BFF"
- },
- interval: 0
- },
- minInterval: 1,
- axisLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- splitLine: {
- //网格线
- lineStyle: {
- type: "dotted", //设置网格线类型 dotted:虚线 solid:实线
- color: "#DADADA"
- },
- show: true //隐藏或显示
- },
- type: "value"
- },
- series: series_data
- };
- var myEcharts = echarts.init(
- document.querySelector(".section1 #classscorePartEcharts")
- );
- myEcharts.clear();
- myEcharts.setOption(option);
- showscoredistributiondata(list, xAxis_data, dataArr);
- }
-
- function showscoredistributiondata(list, xAxis_data) {
- var tableobj = {};
- var num = -1,
- rownum = 6; //一行六条数据
- $.each(xAxis_data, function (idx, item) {
- var obj = $.grep(list, function (val) {
- return val.rankname == item && val.subjectid == "zf";
- })[0];
- if ((idx + rownum) % rownum == 0) {
- num++;
- tableobj[num + "goodTableHeadTr1Html"] = '<th rowspan="2">科目</th>';
- tableobj[num + "goodTableHeadTr2Html"] = "";
- tableobj[num + "trHtml"] = '<td><div class="my_cell">全科</div></td>';
- }
- tableobj[num + "goodTableHeadTr1Html"] +=
- '<th colspan="2">' + item + "</th>";
- tableobj[num + "goodTableHeadTr2Html"] += "<th>人数</th><th>比例</th>";
- tableobj[num + "trHtml"] +=
- '<td><div class="my_cell">' +
- obj.stunum +
- '</div></td><td><div class="my_cell">' +
- obj.sturate +
- "%</div></td>";
- });
- //计算表格高度 页面高1047 剩余高度582 表头62.5 内容27.42
- var tableheight = (27.5 + 62.5 + 15) * (num + 1);
- var page = {
- 1: "",
- 2: "",
- 3: ""
- }; //页数
- var table = "";
- var itemheight = 27.5 + 62.5 + 15; //单表高度
- var maxheight = 0;
- for (var i = 0; i < num + 1; i++) {
- maxheight = itemheight * (i + 1);
- var content =
- ' <table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
- tableobj[i + "goodTableHeadTr1Html"] +
- '</tr><tr class="goodTableHeadTr2">' +
- tableobj[i + "goodTableHeadTr2Html"] +
- '</tr></thead><tbody class="goodTableTbody">' +
- tableobj[i + "trHtml"] +
- "</tbody></table>";
- //计算剩余高度是否能显示最后一个表格
- if (maxheight > 582 && 582 - maxheight < itemheight) {
- page[1] += content;
- } else if (maxheight > 1629 && 1629 - maxheight < itemheight) {
- page[2] += content;
- } else {
- table += content;
- }
- }
- $(".table_num0 .scoredistribution").html(table);
- if (tableheight > 582) {
- //添加第一页
- $(".table_num0").after(
- '<div class="page_root section_2_part table_num1"></div>'
- );
- $(".table_num1").html(page[1]);
- } else if (tableheight > 1629) {
- //添加第二页
- $(".table_num1").after(
- '<div class="page_root section_2_part table_num2"></div>'
- );
- $(".table_num2").html(page[2]);
- }
- }
-
- function initgoodbadSubjectEcharts(list) {
- console.log(list);
- var schoolrate = [],
- classrate = [],
- legendlist = [ "全年级",list[0].classname];
- console.log(legendlist);
- $.each(list, function (idx, item) {
- if (item.subjectname != "全科") {
- classrate.push(
- parseInt(
- ((item.classavgscore - item.schoolavgscore) / item.bzc) * 10000
- ) / 100 || 0
- );
- schoolrate.push(
- parseInt((item.classavgscore / item.schoolavgscore) * 10000) / 100 || 0
- );
- }
- });
- // 求出数组最大值
- let arr = [...schoolrate, ...classrate],yssubject = "",lssubject = "";
- let arr1 = Math.max.apply(null, arr);
- let maxnum = parseInt((arr1 + 10) / 10) * 10;
- let arrList = [];
- $.each(list, function (idx, item) {
- if (item.subjectname != "全科") {
- let j = {
- name: item.subjectname,
- max: maxnum
- };
- arrList.push(j);
- if (item.bzc > item.qkbzc) {
- yssubject += item.subjectname + "、";
- } else {
- lssubject += item.subjectname + "、";
- }
- }
- });
- yssubject = yssubject.substr(0, yssubject.length - 1);
- lssubject = lssubject.substr(0, lssubject.length - 1);
- $(".section1 .yssubject").text(yssubject); // 优势
- $(".section1 .lssubject").text(lssubject); // 劣势
- var option = {
- animation: false,
- color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
- legend: {
- icon: "rectRound",
- itemWidth: $.UnitUtil.mm2px(2),
- itemHeight: $.UnitUtil.mm2px(2),
- data: legendlist,
- x: "center",
- y: "bottom"
- },
- grid: {
- top: $.UnitUtil.mm2px(10),
- left: 0,
- right: 0,
- bottom: $.UnitUtil.mm2px(8),
- containLabel: true
- },
- radar: {
- radius: "60%",
- center: ["50%", "55%"],
- indicator: arrList
- },
- series: {
- type: "radar",
- tooltip: {
- trigger: "item"
- },
- // areaStyle: {}, //内部阴影
- data: [
- {
- value: schoolrate,
- label: {
- show: true,
- formatter: function (params) {
- return params.value;
- }
- },
- name: "全年级"
- },
- {
- value: classrate,
- label: {
- show: true,
- formatter: function (params) {
- return params.value;
- }
- },
- name: list[0].classname
- }
- ]
- }
- };
- var myEcharts = echarts.init(
- document.querySelector(".section1 #goodbadSubjectEcharts")
- );
- myEcharts.clear();
- myEcharts.setOption(option);
- showgoodbadtable(list,legendlist,schoolrate,classrate);
- }
-
- function showgoodbadtable (list, legendlist, schoolrate, classrate) {
- var table = "", goodTableHeadTr1Html = '<th rowspan="2">班级</th>', goodTableHeadTr2Html = "", trHtml = "";
- $.each(list, function (idx, item) {
- if (item.subjectname != "全科") {
- goodTableHeadTr1Html += '<th colspan="2">' + item.subjectname + "</th>";
- }
- })
- $.each(legendlist, function (idx, item) {
- trHtml += '<tr><th colspan="2">' + item + "</th>";
- if (idx == 0) {
- $.each(schoolrate, function (idx, item) {
- trHtml += '<th colspan="2">' + item + "%</th>";
- })
- } else {
- $.each(classrate, function (idx, item) {
- trHtml += '<th colspan="2">' + item + "%</th>";
- })
- }
-
- })
- table = '<table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
- goodTableHeadTr1Html + '</tr></thead><tbody class="goodTableTbody">' +
- trHtml + '</tbody></table>'
- $(".section1 .goodbadtable").html(table);
- console.log(table);
- }
- var parameter = JSON.parse($(".section_1_html_root").data("page-params"));
- var xAxis_data = [],
- html = "";
- var mfclass = {
- num: 0,
- classname: ""
- },
- yxclass = {
- num: 0,
- classname: ""
- },
- lhclass = {
- num: 0,
- classname: ""
- },
- jgclass = {
- num: 0,
- classname: ""
- },
- dfclass = {
- num: 0,
- classname: ""
- },
- skclass = {
- num: 0,
- classname: ""
- },
- qkclass = {
- num: 0,
- classname: ""
- },
- goodclass = {
- num: 0,
- classname: ""
- },
- badclass = {
- num: 0,
- classname: ""
- };
- for (var i = 0; i < parameter.xkcj.length; i++) {
- var item = parameter.xkcj[i];
- if (item.subjectname == "总分") {
- item.subjectname = "全科";
- } else {
- if (mfclass.num < item.allscore) {
- mfclass = {
- num: item.allscore,
- classname: item.subjectname
- };
- }
- if (yxclass.num < item.yxrate) {
- yxclass = {
- num: item.yxrate,
- classname: item.subjectname
- };
- }
- if (lhclass.num < item.lhrate) {
- lhclass = {
- num: item.lhrate,
- classname: item.subjectname
- };
- }
- if (jgclass.num < item.jgrate) {
- jgclass = {
- num: item.jgrate,
- classname: item.subjectname
- };
- }
- if (dfclass.num < item.dfrate) {
- dfclass = {
- num: item.dfrate,
- classname: item.subjectname
- };
- }
- if (skclass.num < item.stunum) {
- skclass = {
- num: item.stunum,
- classname: item.subjectname
- };
- }
- if (qkclass.num < item.missnum) {
- qkclass = {
- num: item.missnum,
- classname: item.subjectname
- };
- }
- if (item.bzc > item.qkbzc) {
- goodclass.classname += item.subjectname + "、";
- } else {
- badclass.classname += item.subjectname + "、";
- }
- }
- html +=
- '<tr><td><div class="my_cell">' +
- (item.subjectname || 0) +
- '</div></td><td><div class="my_cell">' +
- (item.stunum || 0) +
- '</div></td><td><div class="my_cell">' +
- (item.missnum || 0) +
- '</div></td><td><div class="my_cell">' +
- (item.score || 0) +
- '</div></td><td><div class="my_cell">' +
- (item.maxscore || 0) +
- '</div></td><td><div class="my_cell">' +
- (item.minscore || 0) +
- '</div></td><td><div class="my_cell">' +
- (item.avgscore || 0) +
- '</div></td><td><div class="my_cell">' +
- (item.yxrate || 0) +
- "%" +
- '</div></td><td><div class="my_cell">' +
- (item.lhrate || 0) +
- "%" +
- '</div></td><td><div class="my_cell">' +
- (item.jgrate || 0) +
- "%" +
- '</div></td><td><div class="my_cell">' +
- (item.dfrate || 0) +
- "%" +
- '</div></td><td><div class="my_cell">' +
- (item.bzc || 0) +
- "%</div></td></tr>";
- xAxis_data.push(item.subjectname);
- }
- goodclass.classname = goodclass.classname.substr(
- 0,
- goodclass.classname.length - 1
- );
- badclass.classname = badclass.classname.substr(
- 0,
- badclass.classname.length - 1
- );
- console.log(parameter);
- $(".section1 .mfclass").text(mfclass.classname); //满分
- $(".section1 .yxclass").text(yxclass.classname); //优秀
- $(".section1 .lhclass").text(lhclass.classname); //良好
- $(".section1 .jgclass").text(jgclass.classname); //及格
- $(".section1 .dfclass").text(dfclass.classname); //低分
- $(".section1 .skclass").text(skclass.classname); //实考
- $(".section1 .qkclass").text(qkclass.classname); // 缺考
- $(".section1 .goodclass").text(goodclass.classname); //较好
- $(".section1 .badclass").text(badclass.classname); // 较差
- $(".section1 .tbody").html(html); //学科成绩整体分析
- initAverageScoreEcharts(parameter.xkcj, xAxis_data);
- initExcellenceRateEcharts(parameter.xkcj, xAxis_data);
- initExamnumEcharts(parameter.xkcj, xAxis_data);
- initbzcEcharts(parameter.xkcj, xAxis_data);
- initexamaverageEcharts(parameter.xkcj, xAxis_data);
- initscoreGradeEcharts(parameter.fsdjtj, xAxis_data);
- initclassscorePartEcharts(parameter.fsdtj);
- initgoodbadSubjectEcharts(parameter.xkcj);
- document.documentElement.scrollTop = 6200;
- });
|