$(function () { function classscorePartEcharts (s_index, obj) { var legend_data = []; legend_data.push(obj.subjectname); var xAxis_data = []; var dataArr = []; var list = $.grep(obj.ranks, function (val) { return val.classid == 0; }); $.each(list, function (index, item) { xAxis_data.push(item.rankname); dataArr.push(item.stunum); }); var series_data = [ { name: obj.subjectname, type: "line", symbol: "circle", stack: obj.subjectname, 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: legend_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(".part_" + s_index + " #classPartEcharts") ); myEcharts.clear(); myEcharts.setOption(option); showgraphicaldata(obj, xAxis_data, s_index); } function showgraphicaldata (obj, xAxis_data, s_index) { //图表数据 var data = JSON.parse(JSON.stringify(obj)); var calsslist = []; var goodTableHeadTr1Html = '