From f9f0ca1ddbe078627d9414cd5243729aa06a6755 Mon Sep 17 00:00:00 2001 From: Zhang HaoYang <1304907854@qq.com> Date: Mon, 10 Jul 2023 10:10:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Ranking/Ranking.vue | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/components/Ranking/Ranking.vue b/src/components/Ranking/Ranking.vue index 1e0f168..97d62b8 100644 --- a/src/components/Ranking/Ranking.vue +++ b/src/components/Ranking/Ranking.vue @@ -307,7 +307,7 @@ export default { that.showData = JSON.parse(JSON.stringify(that.showData).replace(/count/g,"count")) if(index == false){ this.getRendererLiscense(); - }else{ + }if(index == true){ this.$refs.totalContent.style.display = 'none'; this.getPie(); } @@ -315,13 +315,8 @@ export default { // 饼图: getPie(){ var that = this; - // let name = []; - // let value = []; - // for(let i=0;i < that.showData.length;i++){ - // name.push(that.showData[i]['license']); - // value.push(that.showData[i]['count']); - // } - + that.licensesNum = JSON.parse(JSON.stringify(that.showData).replace(/license/g,"name")); + that.licensesNum = JSON.parse(JSON.stringify(that.showData).replace(/count/g,"value")) that.MyOption = { tooltip: { trigger: 'item', //item数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。 @@ -333,7 +328,7 @@ export default { }, series: [{ type: 'pie', - data: that.showData, + data: that.licensesNum, label: {//饼图文字的显示 show: true, //默认 显示文字 formatter: function (arg) { @@ -365,7 +360,7 @@ export default { let name = []; let value = []; for(let i=0;i < that.showData.length;i++){ - name.push(that.showData[i]['license']); + name.push(that.showData[i]['name']); value.push(that.showData[i]['count']); } that.MyOption = {