gengx
This commit is contained in:
@@ -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 + "%"
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user