|
@@ -32,22 +32,22 @@ export default {
|
|
|
],
|
|
|
legend: {
|
|
|
// data: ['语文', '数学', '英语']
|
|
|
- right:5,
|
|
|
- data:[
|
|
|
+ right: 5,
|
|
|
+ data: [
|
|
|
{
|
|
|
- name:'语文',
|
|
|
- textStyle:{
|
|
|
- color:'#FFF'
|
|
|
+ name: '语文',
|
|
|
+ textStyle: {
|
|
|
+ color: '#FFF'
|
|
|
}
|
|
|
- },{
|
|
|
- name:'数学',
|
|
|
- textStyle:{
|
|
|
- color:'#FFF'
|
|
|
+ }, {
|
|
|
+ name: '数学',
|
|
|
+ textStyle: {
|
|
|
+ color: '#FFF'
|
|
|
}
|
|
|
- },{
|
|
|
- name:'英语',
|
|
|
- textStyle:{
|
|
|
- color:'#FFF'
|
|
|
+ }, {
|
|
|
+ name: '英语',
|
|
|
+ textStyle: {
|
|
|
+ color: '#FFF'
|
|
|
}
|
|
|
}
|
|
|
]
|
|
@@ -65,9 +65,9 @@ export default {
|
|
|
trigger: 'axis'
|
|
|
},
|
|
|
grid: {
|
|
|
- left: '3%',
|
|
|
- right: '4%',
|
|
|
- bottom: '3%',
|
|
|
+ left: '0%',
|
|
|
+ right: '40px',
|
|
|
+ bottom: '0%',
|
|
|
containLabel: true
|
|
|
},
|
|
|
// toolbox: {
|
|
@@ -122,6 +122,30 @@ export default {
|
|
|
stack: '总量',
|
|
|
barMaxWidth: 30,
|
|
|
data: [85, 89, 88, 92, 99]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '总分',
|
|
|
+ type: 'line',
|
|
|
+ itemStyle: {
|
|
|
+ color: '#11C2EE',
|
|
|
+ width: 2
|
|
|
+ },
|
|
|
+ symbol: 'none',
|
|
|
+ lineStyle: {
|
|
|
+ type: 'dashed',
|
|
|
+ width: 0
|
|
|
+ },
|
|
|
+ markLine: {
|
|
|
+ data: [
|
|
|
+ { type: 'average' }
|
|
|
+ ],
|
|
|
+ lineStyle: {
|
|
|
+ color: '#11C2EE',
|
|
|
+ type: 'dashed',
|
|
|
+ width: 2
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: [272, 271, 273, 279, 273]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
@@ -138,6 +162,29 @@ export default {
|
|
|
this.progressPie.resize()
|
|
|
})
|
|
|
})
|
|
|
+ this.progressPie.on('legendselectchanged', (params) =>{
|
|
|
+ console.log(params)
|
|
|
+ let active = this.option.series.filter(item=>{
|
|
|
+ if(params.selected[item.name]){
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let score = []
|
|
|
+ active.forEach((item)=>{
|
|
|
+ item.data.forEach((scoreItem,index)=>{
|
|
|
+ if(!score[index]) score[index] = 0
|
|
|
+ score[index] += scoreItem
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log('active',active)
|
|
|
+ console.log('score',score)
|
|
|
+ let len = this.option.series.length
|
|
|
+ this.option.series[len-1].data = score
|
|
|
+ this.progressPie.setOption(this.option)
|
|
|
+
|
|
|
+ });
|
|
|
},
|
|
|
watch: {
|
|
|
pieData: {
|