|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560 |
- $(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.score);
- maxscore.push(item.maxscore);
- minscore.push(item.minscore);
- avgscore.push(item.avgscore);
- }
- 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($(".section1 #averagescoreEcharts")[0]);
- 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($(".section1 #excellencerateEcharts")[0]);
- 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($(".section1 #examnumEcharts")[0]);
- 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($(".section1 #bzcEcharts")[0]);
- myEcharts.clear();
- myEcharts.setOption(option);
- }
- var parameter = JSON.parse($(".section_1_html_root").data("page-params"));
- $(".section1 .classnum").text(parameter.classnum);
- $(".section1 .stunum").text(parameter.stunum);
- $(".section1 .missnum").text(parameter.missnum);
- $(".section1 .subjectnum").text(parameter.subjectnum);
- $(".section1 .maxscore").text(parameter.maxscore);
- $(".section1 .avgscore").text(parameter.avgscore);
- $(".section1 .mixscore").text(parameter.mixscore);
- var xAxis_data = [],html = "";
- var mfclass = {
- num: 0,
- classname: ""
- },yxclass = {
- num: 0,
- classname: ""
- },jgclass = {
- num: 100,
- classname: ""
- },skclass = {
- num: 0,
- classname: ""
- },qkclass = {
- num: 0,
- classname: ""
- };
- for(var i=0;i<parameter.subjects.length;i++){
- var item = parameter.subjects[i];
- if(item.subjectname == "总分"){
- item.subjectname = "全部班级";
- }else{
- if (mfclass.num < item.score) {
- mfclass = {
- num: item.score,
- classname: item.subjectname
- };
- }
- if (yxclass.num < item.yxrate) {
- yxclass = {
- num: item.yxrate,
- classname: item.subjectname
- };
- }
- if (jgclass.num > item.jgrate) {
- jgclass = {
- num: item.jgrate,
- 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
- };
- }
- 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);
- }
- $(".section1 .mfclass").text(mfclass.classname);
- $(".section1 .yxclass").text(yxclass.classname);
- $(".section1 .jgclass").text(jgclass.classname);
- $(".section1 .skclass").text(skclass.classname);
- $(".section1 .qkclass").text(qkclass.classname);
- $(".section1 .tbody").html(html);
- initAverageScoreEcharts(parameter.subjects,xAxis_data);
- initExcellenceRateEcharts(parameter.subjects,xAxis_data);
- initExamnumEcharts(parameter.subjects,xAxis_data);
- initbzcEcharts(parameter.subjects,xAxis_data);
- });
|