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 = {