This commit is contained in:
2023-07-10 10:15:00 +08:00
parent f9f0ca1ddb
commit e3b4116993

View File

@@ -315,8 +315,9 @@ export default {
// 饼图:
getPie(){
var that = this;
that.licensesNum = JSON.parse(JSON.stringify(that.showData).replace(/license/g,"name"));
that.licensesNum = JSON.parse(JSON.stringify(that.showData).replace(/count/g,"value"))
let tmp = that.licensesNum;
tmp = JSON.parse(JSON.stringify(tmp).replace(/license/g,"name"));
tmp = JSON.parse(JSON.stringify(tmp).replace(/count/g,"value"))
that.MyOption = {
tooltip: {
trigger: 'item', //item数据项图形触发主要在散点图饼图等无类目轴的图表中使用。
@@ -328,11 +329,10 @@ export default {
},
series: [{
type: 'pie',
data: that.licensesNum,
data: tmp,
label: {//饼图文字的显示
show: true, //默认 显示文字
formatter: function (arg) {
console.log(arg);
return arg.name + ' 项目 ' + arg.value + " 个 " +'\n'+ arg.percent + "%"
}
},