This commit is contained in:
曹辉 2022-08-23 11:12:00 +08:00
parent 6dde8e62e3
commit bf5c229238
6 changed files with 505 additions and 477 deletions

View File

@ -261,7 +261,7 @@
<div slot="header" style="text-align: center"> <div slot="header" style="text-align: center">
<img style="width: 40px" src="@/icons/笑脸.png" alt="" /> <img style="width: 40px" src="@/icons/笑脸.png" alt="" />
<div><!-- card title -->学生此批次暂没数据</div> <div><!-- card title -->幼儿园此批次暂无数据</div>
</div> </div>
<!-- card body --> <!-- card body -->
</el-card> </el-card>
@ -344,164 +344,169 @@ export default {
methods: { methods: {
analysisinfo() { analysisinfo() {
analysis(this.analysisqueryParams).then((res) => { analysis(this.analysisqueryParams).then((res) => {
this.analysislist = res.data; if (res.data == [] || !res.data) {
console.log(this.analysislist); this.itemshow2 = true;
this.options(); this.itemshow = false;
var app = {}; } else {
this.analysislist = res.data;
console.log(this.analysislist);
this.options();
var app = {};
var myChart = echarts.init(document.getElementById("main")); var myChart = echarts.init(document.getElementById("main"));
var option; var option;
const posList = [ const posList = [
"left", "left",
"right", "right",
"top", "top",
"bottom", "bottom",
"inside", "inside",
"insideTop", "insideTop",
"insideLeft", "insideLeft",
"insideRight", "insideRight",
"insideBottom", "insideBottom",
"insideTopLeft", "insideTopLeft",
"insideTopRight", "insideTopRight",
"insideBottomLeft", "insideBottomLeft",
"insideBottomRight", "insideBottomRight",
]; ];
app.configParameters = { app.configParameters = {
rotate: { rotate: {
min: 0, min: 0,
max: 90, max: 90,
},
align: {
options: {
left: "left",
center: "center",
right: "right",
}, },
}, align: {
verticalAlign: { options: {
options: { left: "left",
top: "top", center: "center",
middle: "middle", right: "right",
bottom: "bottom",
},
},
position: {
options: posList.reduce(function (map, pos) {
map[pos] = pos;
return map;
}, {}),
},
distance: {
min: 0,
max: 100,
},
};
app.config = {
rotate: 0,
align: "center",
verticalAlign: "middle",
position: "top",
distance: 15,
onChange: function () {
const labelOption = {
rotate: app.config.rotate,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
position: app.config.position,
distance: app.config.distance,
};
myChart.setOption({
series: [
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
],
});
},
};
const labelOption = {
show: true,
position: app.config.position,
distance: app.config.distance,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
rotate: app.config.rotate,
formatter: "{c}",
fontSize: 16,
rich: {
name: {},
},
};
option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
legend: {
data: ["男", "女"],
},
xAxis: [
{
type: "category",
axisTick: { show: false },
data: ["3-4岁", "4-5岁", "5-6岁", "6岁以上"],
},
],
yAxis: [
{
type: "value",
},
],
series: [
{
name: "男",
type: "bar",
barGap: 0,
color: "#60C5F1",
label: labelOption,
emphasis: {
focus: "series",
}, },
data: [
this.analysislist.threeAndFourMaleCount,
this.analysislist.fourAndFiveMaleCount,
this.analysislist.fiveAndSixMaleCount,
this.analysislist.sixAndMoreMaleCount,
],
}, },
{ verticalAlign: {
name: "女", options: {
type: "bar", top: "top",
color: "#98E0AD", middle: "middle",
label: labelOption, bottom: "bottom",
emphasis: {
focus: "series",
}, },
data: [
this.analysislist.threeAndFourFeMaleCount,
this.analysislist.fourAndFiveFeMaleCount,
this.analysislist.fiveAndSixFeMaleCount,
this.analysislist.sixAndMoreFeMaleCount,
],
}, },
], position: {
}; options: posList.reduce(function (map, pos) {
map[pos] = pos;
return map;
}, {}),
},
distance: {
min: 0,
max: 100,
},
};
app.config = {
rotate: 0,
align: "center",
verticalAlign: "middle",
position: "top",
distance: 15,
onChange: function () {
const labelOption = {
rotate: app.config.rotate,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
position: app.config.position,
distance: app.config.distance,
};
myChart.setOption({
series: [
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
],
});
},
};
const labelOption = {
show: true,
position: app.config.position,
distance: app.config.distance,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
rotate: app.config.rotate,
formatter: "{c}",
fontSize: 16,
rich: {
name: {},
},
};
option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
legend: {
data: ["男", "女"],
},
xAxis: [
{
type: "category",
axisTick: { show: false },
data: ["3-4岁", "4-5岁", "5-6岁", "6岁以上"],
},
],
yAxis: [
{
type: "value",
},
],
series: [
{
name: "男",
type: "bar",
barGap: 0,
color: "#60C5F1",
label: labelOption,
emphasis: {
focus: "series",
},
data: [
this.analysislist.threeAndFourMaleCount,
this.analysislist.fourAndFiveMaleCount,
this.analysislist.fiveAndSixMaleCount,
this.analysislist.sixAndMoreMaleCount,
],
},
{
name: "女",
type: "bar",
color: "#98E0AD",
label: labelOption,
emphasis: {
focus: "series",
},
data: [
this.analysislist.threeAndFourFeMaleCount,
this.analysislist.fourAndFiveFeMaleCount,
this.analysislist.fiveAndSixFeMaleCount,
this.analysislist.sixAndMoreFeMaleCount,
],
},
],
};
option && myChart.setOption(option); option && myChart.setOption(option);
this.itemshow = ture; this.itemshow = true;
this.itemshow2 = false; this.itemshow2 = false;
}
}); });
}, },
options() { options() {

View File

@ -552,8 +552,8 @@ export default {
pageSize: 10, pageSize: 10,
// studentId: "10", // studentId: "10",
// batchCode: "PC202208030005", // batchCode: "PC202208030005",
studentId: "", // studentId: "",
batchCode: "", // batchCode: "",
}, },
}; };
}, },
@ -658,6 +658,10 @@ export default {
}, },
// //
batchCodeshowclick() { batchCodeshowclick() {
this.spanArr = [];
this.position = 0; //
this.spanArr2 = [];
this.position2 = 0; //
if (this.queryParams.studentId == "") { if (this.queryParams.studentId == "") {
this.$message.error("请先选择学生"); this.$message.error("请先选择学生");
} else { } else {
@ -669,9 +673,9 @@ export default {
batchCodeclick(row) { batchCodeclick(row) {
this.batchCodeName = row.batchName; this.batchCodeName = row.batchName;
this.batchCodeId = row.id; this.batchCodeId = row.id;
this.analysisqueryParams.batchCode = row.batchCode; this.queryParams.batchCode = row.batchCode;
this.batchCodeshow = false; this.batchCodeshow = false;
// this.listActioninfo(); this.listActioninfo();
}, },
// //
testScore() { testScore() {
@ -685,7 +689,7 @@ export default {
this.studentname = row.studentName; this.studentname = row.studentName;
this.studentId = row.id; this.studentId = row.id;
this.studentshow = false; this.studentshow = false;
this.analysisqueryParams.studentId = row.id; this.queryParams.studentId = row.id;
}, },
// //
studentlist() { studentlist() {

View File

@ -263,14 +263,19 @@
<el-col :span="24" :offset="0"> <el-col :span="24" :offset="0">
<div style="margin: 0 auto"> <div style="margin: 0 auto">
<div <div
style="display: flex; text-align: center; justify-content: center" style="
display: flex;
text-align: center;
justify-content: center;
color: #fff;
"
> >
<div <div
style=" style="
width: 120px; width: 120px;
line-height: 60px; line-height: 60px;
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
background: #f0f0f0; background: #3c9299;
" "
> >
年龄 年龄
@ -280,7 +285,7 @@
width: 120px; width: 120px;
line-height: 60px; line-height: 60px;
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
background: #f0f0f0; background: #3c9299;
" "
> >
平均总分 平均总分
@ -291,7 +296,7 @@
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
background: #f0f0f0; background: #3c9299;
" "
> >
{{ item.parentName }} {{ item.parentName }}
@ -301,8 +306,8 @@
display: flex; display: flex;
line-height: 30px; line-height: 30px;
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
background: #f0f0f0; background: #3c9299;
font-size: 20px; font-size: 14px;
" "
> >
<div <div
@ -363,7 +368,7 @@
<div slot="header" style="text-align: center"> <div slot="header" style="text-align: center">
<img style="width: 40px" src="@/icons/笑脸.png" alt="" /> <img style="width: 40px" src="@/icons/笑脸.png" alt="" />
<div><!-- card title -->学生此批次暂没成绩</div> <div><!-- card title -->班级此批次暂无成绩</div>
</div> </div>
<!-- card body --> <!-- card body -->
</el-card> </el-card>
@ -386,7 +391,7 @@ export default {
name: "classconstitution", name: "classconstitution",
data() { data() {
return { return {
itemshow: true, itemshow: false,
itemshow2: false, itemshow2: false,
total1: 0, total1: 0,
total2: 0, total2: 0,
@ -445,10 +450,13 @@ export default {
testScorelist: [], testScorelist: [],
// //
ClassListlist: { ClassListlist: {
// batchCode: "", batchCode: "",
batchCode: "PC202208030005", kindergartenId: "",
kindergartenId: "18", classId: "",
classId: "2",
// batchCode: "PC202208030005",
// kindergartenId: "18",
// classId: "2",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}, },
@ -468,22 +476,21 @@ export default {
created() { created() {
this.getList(); this.getList();
this.class(); this.class();
this.ClassListinfo(); // this.ClassListinfo();
}, },
methods: { methods: {
ClassListinfo() { ClassListinfo() {
ClassList(this.ClassListlist).then((res) => { ClassList(this.ClassListlist).then((res) => {
console.log(res); console.log(res);
this.totalAvgFraction = res.data.totalAvgFraction;
this.categoryTableNameList = res.data.categoryTableNameList;
this.categoryAgeFractionList = res.data.categoryAgeFractionList;
this.categoryScoreList = res.data.categoryScoreList;
if (res.data == [] || !res.data) { if (res.data == [] || !res.data) {
this.itemshow2 = true; this.itemshow2 = true;
this.itemshow = false; this.itemshow = false;
} else { } else {
this.totalAvgFraction = res.data.totalAvgFraction;
this.categoryTableNameList = res.data.categoryTableNameList;
this.categoryAgeFractionList = res.data.categoryAgeFractionList;
this.categoryScoreList = res.data.categoryScoreList;
var list = []; var list = [];
this.categoryTableNameList.forEach((e) => { this.categoryTableNameList.forEach((e) => {
e.childrenTableNameList.forEach((el) => { e.childrenTableNameList.forEach((el) => {
@ -683,6 +690,7 @@ export default {
this.batchCodeId = row.id; this.batchCodeId = row.id;
this.ClassListlist.batchCode = row.batchCode; this.ClassListlist.batchCode = row.batchCode;
this.batchCodeshow = false; this.batchCodeshow = false;
this.ClassListinfo();
}, },
// //
testScore() { testScore() {
@ -723,6 +731,7 @@ export default {
}, },
// //
kindergartenNameclick(row) { kindergartenNameclick(row) {
this.classqueryParams.kindergartenId = row.id;
this.ClassListlist.kindergartenId = row.id; this.ClassListlist.kindergartenId = row.id;
this.kindergartenName = row.kindergartenName; this.kindergartenName = row.kindergartenName;
this.kindergartenId = row.id; this.kindergartenId = row.id;

View File

@ -593,8 +593,8 @@ export default {
synthesizelist: { synthesizelist: {
studentId: "", studentId: "",
batchCode: "", batchCode: "",
studentId: "10", // studentId: "10",
batchCode: "PC202208030005", // batchCode: "PC202208030005",
}, },
// //
testqueryParams: { testqueryParams: {
@ -607,7 +607,7 @@ export default {
created() { created() {
this.getList(); this.getList();
this.class(); this.class();
this.synthesizeinfo(); // this.synthesizeinfo();
}, },
methods: { methods: {
// //

View File

@ -211,7 +211,7 @@
<div slot="header" style="text-align: center"> <div slot="header" style="text-align: center">
<img style="width: 40px" src="@/icons/笑脸.png" alt="" /> <img style="width: 40px" src="@/icons/笑脸.png" alt="" />
<div><!-- card title -->学生此批次暂没数据</div> <div><!-- card title -->批次暂无数据</div>
</div> </div>
<!-- card body --> <!-- card body -->
</el-card> </el-card>
@ -321,237 +321,242 @@ export default {
methods: { methods: {
analysisinfo() { analysisinfo() {
analysis(this.analysisqueryParams).then((res) => { analysis(this.analysisqueryParams).then((res) => {
this.analysislist = res.data; if (!res.data) {
console.log(this.analysislist); this.itemshow2=true;
var yclassname = []; this.itemshow=false;
var grilsheight = []; } else {
var boyheight = []; this.analysislist = res.data;
var boyweight = []; console.log(this.analysislist);
var grilsweight = []; var yclassname = [];
var grilsheight = [];
var boyheight = [];
var boyweight = [];
var grilsweight = [];
for (var i = 0; i < this.analysislist.length; i++) { for (var i = 0; i < this.analysislist.length; i++) {
this.analysislist[i].weightAndHeightAvgScoreList.forEach((el) => { this.analysislist[i].weightAndHeightAvgScoreList.forEach((el) => {
if (el.itemCode == "H001" && el.studentSex == "MALE") { if (el.itemCode == "H001" && el.studentSex == "MALE") {
boyheight.push(el.averageScore); boyheight.push(el.averageScore);
} else if (el.itemCode == "H001" && el.studentSex == "FEMALE") { } else if (el.itemCode == "H001" && el.studentSex == "FEMALE") {
grilsheight.push(el.averageScore); grilsheight.push(el.averageScore);
} else if (el.itemCode == "W001" && el.studentSex == "FEMALE") { } else if (el.itemCode == "W001" && el.studentSex == "FEMALE") {
grilsweight.push(el.averageScore); grilsweight.push(el.averageScore);
} else if (el.itemCode == "W001" && el.studentSex == "MALE") { } else if (el.itemCode == "W001" && el.studentSex == "MALE") {
boyweight.push(el.averageScore); boyweight.push(el.averageScore);
} }
});
if (grilsheight.length == i) {
grilsheight.push(0);
}
if (boyheight.length == i) {
boyheight.push(0);
}
if (boyweight.length == i) {
boyweight.push(0);
}
if (grilsweight.length == i) {
grilsweight.push(0);
}
}
this.analysislist.forEach((e) => {
yclassname.push(e.className);
});
console.log(grilsheight, boyheight);
console.log(grilsweight, boyweight);
var app = {};
var myChart = echarts.init(document.getElementById("main"));
var myChart2 = echarts.init(document.getElementById("main2"));
var option;
var option2;
const posList = [
"left",
"right",
"top",
"bottom",
"inside",
"insideTop",
"insideLeft",
"insideRight",
"insideBottom",
"insideTopLeft",
"insideTopRight",
"insideBottomLeft",
"insideBottomRight",
];
app.configParameters = {
rotate: {
min: 0,
max: 90,
},
align: {
options: {
left: "left",
center: "center",
right: "right",
},
},
verticalAlign: {
options: {
top: "top",
middle: "middle",
bottom: "bottom",
},
},
position: {
options: posList.reduce(function (map, pos) {
map[pos] = pos;
return map;
}, {}),
},
distance: {
min: 0,
max: 100,
},
};
app.config = {
rotate: 0,
align: "center",
verticalAlign: "middle",
position: "top",
distance: 15,
onChange: function () {
const labelOption = {
rotate: app.config.rotate,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
position: app.config.position,
distance: app.config.distance,
};
myChart.setOption({
series: [
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
],
}); });
}, if (grilsheight.length == i) {
}; grilsheight.push(0);
const labelOption = { }
show: true, if (boyheight.length == i) {
position: app.config.position, boyheight.push(0);
distance: app.config.distance, }
align: app.config.align, if (boyweight.length == i) {
verticalAlign: app.config.verticalAlign, boyweight.push(0);
rotate: app.config.rotate, }
formatter: "{c}", if (grilsweight.length == i) {
fontSize: 16, grilsweight.push(0);
rich: { }
name: {}, }
},
}; this.analysislist.forEach((e) => {
option = { yclassname.push(e.className);
tooltip: { });
trigger: "axis", console.log(grilsheight, boyheight);
axisPointer: { console.log(grilsweight, boyweight);
type: "shadow", var app = {};
var myChart = echarts.init(document.getElementById("main"));
var myChart2 = echarts.init(document.getElementById("main2"));
var option;
var option2;
const posList = [
"left",
"right",
"top",
"bottom",
"inside",
"insideTop",
"insideLeft",
"insideRight",
"insideBottom",
"insideTopLeft",
"insideTopRight",
"insideBottomLeft",
"insideBottomRight",
];
app.configParameters = {
rotate: {
min: 0,
max: 90,
}, },
}, align: {
legend: { options: {
data: ["男", "女"], left: "left",
}, center: "center",
xAxis: [ right: "right",
{
type: "category",
axisTick: { show: false },
data: yclassname,
},
],
yAxis: [
{
type: "value",
},
],
series: [
{
name: "男",
type: "bar",
barGap: 0,
color: "#00B050",
label: labelOption,
emphasis: {
focus: "series",
}, },
data: boyheight,
}, },
{ verticalAlign: {
name: "女", options: {
type: "bar", top: "top",
color: "red", middle: "middle",
label: labelOption, bottom: "bottom",
emphasis: {
focus: "series",
}, },
data: grilsheight,
}, },
], position: {
}; options: posList.reduce(function (map, pos) {
option2 = { map[pos] = pos;
tooltip: { return map;
trigger: "axis", }, {}),
axisPointer: {
type: "shadow",
}, },
}, distance: {
legend: { min: 0,
data: ["男", "女"], max: 100,
},
xAxis: [
{
type: "category",
axisTick: { show: false },
data: yclassname,
}, },
], };
yAxis: [ app.config = {
{ rotate: 0,
type: "value", align: "center",
verticalAlign: "middle",
position: "top",
distance: 15,
onChange: function () {
const labelOption = {
rotate: app.config.rotate,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
position: app.config.position,
distance: app.config.distance,
};
myChart.setOption({
series: [
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
],
});
}, },
], };
series: [ const labelOption = {
{ show: true,
name: "男", position: app.config.position,
type: "bar", distance: app.config.distance,
barGap: 0, align: app.config.align,
color: "#00B050", verticalAlign: app.config.verticalAlign,
label: labelOption, rotate: app.config.rotate,
emphasis: { formatter: "{c}",
focus: "series", fontSize: 16,
rich: {
name: {},
},
};
option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
}, },
data: boyweight,
}, },
{ legend: {
name: "女", data: ["男", "女"],
type: "bar", },
color: "red", xAxis: [
label: labelOption, {
emphasis: { type: "category",
focus: "series", axisTick: { show: false },
data: yclassname,
},
],
yAxis: [
{
type: "value",
},
],
series: [
{
name: "男",
type: "bar",
barGap: 0,
color: "#00B050",
label: labelOption,
emphasis: {
focus: "series",
},
data: boyheight,
},
{
name: "女",
type: "bar",
color: "red",
label: labelOption,
emphasis: {
focus: "series",
},
data: grilsheight,
},
],
};
option2 = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
}, },
data: grilsweight,
}, },
], legend: {
}; data: ["男", "女"],
option && myChart.setOption(option); },
option2 && myChart2.setOption(option2); xAxis: [
this.itemshow = true; {
this.itemshow2 = false; type: "category",
axisTick: { show: false },
data: yclassname,
},
],
yAxis: [
{
type: "value",
},
],
series: [
{
name: "男",
type: "bar",
barGap: 0,
color: "#00B050",
label: labelOption,
emphasis: {
focus: "series",
},
data: boyweight,
},
{
name: "女",
type: "bar",
color: "red",
label: labelOption,
emphasis: {
focus: "series",
},
data: grilsweight,
},
],
};
option && myChart.setOption(option);
option2 && myChart2.setOption(option2);
this.itemshow = true;
this.itemshow2 = false;
}
}); });
}, },
// //

View File

@ -332,7 +332,7 @@
<div slot="header" style="text-align: center"> <div slot="header" style="text-align: center">
<img style="width: 40px" src="@/icons/笑脸.png" alt="" /> <img style="width: 40px" src="@/icons/笑脸.png" alt="" />
<div><!-- card title -->学生此批次暂没数据</div> <div><!-- card title -->幼儿园此批次暂无数据</div>
</div> </div>
<!-- card body --> <!-- card body -->
</el-card> </el-card>
@ -427,99 +427,104 @@ export default {
methods: { methods: {
analysisinfo() { analysisinfo() {
analysis(this.analysisqueryParams).then((res) => { analysis(this.analysisqueryParams).then((res) => {
this.totalAvgFraction = res.data.totalAvgFraction;
this.categoryTableNameList = res.data.categoryTableNameList;
this.categoryAgeFractionList = res.data.categoryAgeFractionList;
this.categoryScoreList = res.data.categoryScoreList;
this.firstCategoryScoreList = res.data.firstCategoryScoreList;
console.log(this.firstCategoryScoreList);
if (res.data == [] || !res.data) { if (res.data == [] || !res.data) {
this.itemshow2 = true; this.itemshow2 = true;
this.itemshow = false; this.itemshow = false;
} else { } else {
var list = []; this.totalAvgFraction = res.data.totalAvgFraction;
this.categoryTableNameList.forEach((e) => { this.categoryTableNameList = res.data.categoryTableNameList;
e.childrenTableNameList.forEach((el) => { this.categoryAgeFractionList = res.data.categoryAgeFractionList;
list.push(el.categoryId); this.categoryScoreList = res.data.categoryScoreList;
this.firstCategoryScoreList = res.data.firstCategoryScoreList;
console.log(this.firstCategoryScoreList);
if (res.data == [] || !res.data) {
this.itemshow2 = true;
this.itemshow = false;
} else {
var list = [];
this.categoryTableNameList.forEach((e) => {
e.childrenTableNameList.forEach((el) => {
list.push(el.categoryId);
});
}); });
}); this.categoryAgeFractionList.forEach((el) => {
this.categoryAgeFractionList.forEach((el) => { var list1 = list.map((e) => {
var list1 = list.map((e) => { var num = 0;
var num = 0; var number = el.categoryAvgFractionList.findIndex(
var number = el.categoryAvgFractionList.findIndex( (o) => o.categoryId == e
(o) => o.categoryId == e );
); if (number != -1) {
if (number != -1) { num = el.categoryAvgFractionList[number].avgCategoryFraction;
num = el.categoryAvgFractionList[number].avgCategoryFraction; }
return num;
});
el.list = list1;
});
let seriesData = [];
let yindicator = [];
this.categoryScoreList.forEach((el) => {
console.log(el);
seriesData.push(el.itemFraction);
if (el.avgCategoryName == null) {
el.avgCategoryName = "暂无";
} }
return num; yindicator.push({
name:
el.categoryName + " " + "(" + el.avgCategoryName + "" + ")",
max: el.maxFraction,
});
}); });
el.list = list1;
});
var myChart = echarts.init(document.getElementById("chart"));
let seriesData = []; let option = {
let yindicator = []; //
this.categoryScoreList.forEach((el) => { color: "blue",
console.log(el); radar: {
seriesData.push(el.itemFraction); name: {
if (el.avgCategoryName == null) {
el.avgCategoryName = "暂无";
}
yindicator.push({
name: el.categoryName + " " + "(" + el.avgCategoryName + "" + ")",
max: el.maxFraction,
});
});
var myChart = echarts.init(document.getElementById("chart"));
let option = {
//
color: "blue",
radar: {
name: {
show: true,
color: "black",
},
center: ["50%", "50%"],
//
indicator: yindicator,
shape: "polygon", //, circle:,polygon:()
},
series: [
{
type: "radar",
label: {
show: true, show: true,
color: "blue", // color: "black",
},
areaStyle: {}, //
data: [
{
name: "成绩区域",
value: seriesData,
},
],
areaStyle: {
color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
{
color: "rgba(50, 50, 255, 0.1)",
offset: 0,
},
{
color: "rgba(50, 50, 200, 0.9)",
offset: 1,
},
]),
}, },
center: ["50%", "50%"],
//
indicator: yindicator,
shape: "polygon", //, circle:,polygon:()
}, },
], series: [
}; {
// type: "radar",
myChart.setOption(option); label: {
this.itemshow2 = false; show: true,
this.itemshow = true; color: "blue", //
},
areaStyle: {}, //
data: [
{
name: "成绩区域",
value: seriesData,
},
],
areaStyle: {
color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
{
color: "rgba(50, 50, 255, 0.1)",
offset: 0,
},
{
color: "rgba(50, 50, 200, 0.9)",
offset: 1,
},
]),
},
},
],
};
//
myChart.setOption(option);
this.itemshow2 = false;
this.itemshow = true;
}
} }
}); });
}, },