This commit is contained in:
zhaofang
2022-10-20 14:09:43 +08:00
parent 09f7581ba8
commit b21160ba80
9 changed files with 26 additions and 27 deletions

View File

@@ -458,20 +458,6 @@
show: true,
position: 'center',
formatter:`{total|${this.percentageNum}%}\n{active|来源top3}`,
// formatter: function(name) {
// console.log(name,'name');
// let data = option.series[0].data;
// let total = 0;
// let tarValue = 0; //每一项值
// for (let i = 0; i < data.length; i++) {
// total += data[i].value;
// if (data[i].name == name) {
// tarValue = data[i].value;
// }
// }
// let p = total != 0 ? Math.round((tarValue / total) * 100) + '%' : 0 + '%';
// return ` ${p} ${name}`
// },
rich:{
total:{
fontSize:20,
@@ -516,6 +502,7 @@
name: this.getUType(key)
})
}
// 计算前三百分比
totalList.sort();
totalList = totalList.splice(1,3);
let top3 = null;
@@ -523,8 +510,6 @@
top3+=item;
})
this.percentageNum = (top3/total)*100;
console.log(top3,total,this.percentageNum,'3333');
console.log(totalList,'totalList');
this.chatData = chatData;
this.initChat(chatData);
}