A 2022-07-14 22:08:34 +08:00
commit 5614ef750c
1 changed files with 53 additions and 52 deletions

View File

@ -54,34 +54,35 @@ export default {
methods: {
//
getOption() {
//
let isAllZero = this.dataList.every(item => {
// console.log(item,"item")
// console.log(item,"item")
return item.value == 0
})
console.log(isAllZero,"isAllZero")
let option=null
if(isAllZero==true){
for(let i =0;i<this.dataList.length;i++){
this.dataList[i].name = this.dataList[i].name+" 已完成工作项:"+this.dataList[i].value+"项"
console.log(isAllZero, "isAllZero")
let option = null
if (isAllZero == true) {
for (let i = 0; i < this.dataList.length; i++) {
this.dataList[i].name = this.dataList[i].name + " 已完成工作项:" + this.dataList[i].value + "项"
}
console.log(this.dataList,"this.dataListgroup")
option = {
console.log(this.dataList, "this.dataListgroup")
option = {
tooltip: {
trigger: 'item'
},
//
// graphic:{
// type:'text',
// left:'27%',
// top:'50%',
// style:{
// text:'',
// textAlign:'center',
// fill:'#000',
// graphic:{
// type:'text',
// left:'27%',
// top:'50%',
// style:{
// text:'',
// textAlign:'center',
// fill:'#000',
// }
// },
// }
// },
series: [
{
name: '统计',
@ -113,39 +114,39 @@ export default {
}
]
};
}else{
for(let i =0;i<this.dataList.length;i++){
this.dataList[i].name = this.dataList[i].name+""+this.dataList[i].value+"人"
} else {
for (let i = 0; i < this.dataList.length; i++) {
this.dataList[i].name = this.dataList[i].name + "" + this.dataList[i].value + "人"
}
option = {
tooltip: {
trigger: 'item'
},
series: [
{
name: '统计',
type: 'pie',
center: ['35%', '55%'],
// radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
tooltip: {
trigger: 'item'
},
series: [
{
name: '统计',
type: 'pie',
center: ['35%', '55%'],
// radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
fontSize: '40',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.dataList
}
]
};
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: '40',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.dataList
}
]
};
}
@ -183,7 +184,7 @@ export default {
//
updateEcharts() {
this.myChart.setOption(this.getOption(), true);
console.log( this.dataList," this.dataList")
console.log(this.dataList, " this.dataList")
}
}
}