|
@@ -7,16 +7,27 @@
|
|
|
return {
|
|
|
dataIndex: 1,
|
|
|
progressHistogram: undefined,
|
|
|
- dataInfo: []
|
|
|
+ dataInfo: [],
|
|
|
+ studentList: [],
|
|
|
+ studentName: [],
|
|
|
+ studentScore:[]
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
getData() {
|
|
|
let data = this.$Mock.data.studentList
|
|
|
console.log(data)
|
|
|
- for (var i = 1; i < 15; i++) {
|
|
|
- this.dataInfo.push(i);
|
|
|
- }
|
|
|
+ //for (let i = 0; i < data.length; i++) {
|
|
|
+ // this.studentName.push(data.)
|
|
|
+ //}
|
|
|
+ //for (var i = 0; i < data[0].studentScore.length; i++) {
|
|
|
+ // this.studentList.push(data[0].studentScore[i].name);
|
|
|
+ // this.studentScore.push(data[0].studentScore[i].score);
|
|
|
+ //}
|
|
|
+ //for (var i = 0; i < data[0].studentScore.length; i++) {
|
|
|
+ // this.studentList.push(data[0].studentScore[i].name);
|
|
|
+ // this.studentScore.push(data[0].studentScore[i].score);
|
|
|
+ //}
|
|
|
},
|
|
|
getMap() {
|
|
|
let myChart = this.$echarts.init(document.getElementById('grade'));
|
|
@@ -44,9 +55,18 @@
|
|
|
axisLabel: {
|
|
|
color: 'white'
|
|
|
},
|
|
|
- data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
|
|
|
+ data: this.studentList
|
|
|
},
|
|
|
yAxis: {
|
|
|
+ type: "value",
|
|
|
+ name: "试卷得分",
|
|
|
+ lineStyle: {
|
|
|
+ color: '#fffff',
|
|
|
+ width: 2
|
|
|
+ },
|
|
|
+ nameTextStyle: {
|
|
|
+ color: "#fff"
|
|
|
+ },
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
color: ['#505050']
|
|
@@ -63,14 +83,16 @@
|
|
|
0
|
|
|
],
|
|
|
bottom: 10,
|
|
|
+ color:"#fffff",
|
|
|
"start": 10,
|
|
|
"end": 80,
|
|
|
handleSize: '110%',
|
|
|
handleStyle: {
|
|
|
- color: "#d3dee5",
|
|
|
+ color: "#fffff",
|
|
|
|
|
|
},
|
|
|
- borderColor: "#90979c"
|
|
|
+ borderColor: "#90979c",
|
|
|
+ handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
|
|
|
},
|
|
|
{
|
|
|
"type": "inside",
|
|
@@ -80,9 +102,9 @@
|
|
|
"end": 35
|
|
|
}],
|
|
|
series: [{
|
|
|
- name: '销量',
|
|
|
+ name: '分数',
|
|
|
type: 'bar',
|
|
|
- data: [5, 20, 36, 10, 10, 20]
|
|
|
+ data: this.studentScore
|
|
|
}]
|
|
|
};
|
|
|
myChart.setOption(option);
|
|
@@ -97,8 +119,8 @@
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
#grade{
|
|
|
- width:650px;
|
|
|
- height:300px;
|
|
|
+ width:700px;
|
|
|
+ height:400px;
|
|
|
margin:auto;
|
|
|
}
|
|
|
</style>
|