|
|
@@ -42,12 +42,15 @@ export default { |
|
|
|
...mapGetters(["fontSize"]) |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
let total=0 |
|
|
|
let max = 0; |
|
|
|
this.dataList.forEach(function(obj) { |
|
|
|
if (obj.value > max) { |
|
|
|
max = obj.value; |
|
|
|
} |
|
|
|
total+=obj.value |
|
|
|
}); |
|
|
|
console.log(total) |
|
|
|
// 自定义 other 的图形,增加两条线 |
|
|
|
G2.Shape.registerShape("interval", "sliceShape", { |
|
|
|
draw(cfg, container) { |
|
|
@@ -106,7 +109,7 @@ export default { |
|
|
|
}, |
|
|
|
offset: this.$root.$options.filters.filterPx(0.4,this.fontSize), |
|
|
|
formatter: (val, item) => { |
|
|
|
return val+ "%"; |
|
|
|
return parseInt((val/total)*100)+ "%"; |
|
|
|
} |
|
|
|
}); |
|
|
|
chart.render(); |