|
|
|
@ -44,18 +44,27 @@ export default {
|
|
|
|
|
this.arr1.push({
|
|
|
|
|
value: value1.count,
|
|
|
|
|
name: value1.lawAreas,
|
|
|
|
|
pt: value1.completionRate,
|
|
|
|
|
// pt: value1.completionRate,
|
|
|
|
|
pt: this.NumFilter(value1.completed,value1.count),
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.arr2.push({
|
|
|
|
|
value: value1.count,
|
|
|
|
|
name: value1.lawAreas,
|
|
|
|
|
pt: value1.completionRate
|
|
|
|
|
// pt: value1.completionRate
|
|
|
|
|
pt: this.NumFilter(value1.completed,value1.count)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.initChart();
|
|
|
|
|
},
|
|
|
|
|
NumFilter(numOne,numTwo){
|
|
|
|
|
// if(numOne == 0 || numTwo == 0) {
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
let realVal = parseFloat((numOne / numTwo) * 100).toFixed(2)
|
|
|
|
|
return realVal;
|
|
|
|
|
},
|
|
|
|
|
initChart() {
|
|
|
|
|
var chartDom = document.getElementById("cakeBox");
|
|
|
|
|
var myChart = echarts.init(chartDom);
|
|
|
|
@ -87,7 +96,7 @@ export default {
|
|
|
|
|
trigger: "item",
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
width: "45%",
|
|
|
|
|
width: "35%",
|
|
|
|
|
top: "25%",
|
|
|
|
|
right: "8%",
|
|
|
|
|
orient: "horizontal",
|
|
|
|
@ -95,26 +104,26 @@ export default {
|
|
|
|
|
itemWidth: 10,
|
|
|
|
|
itemHeight: 10,
|
|
|
|
|
icon: "circle",
|
|
|
|
|
formatter: function (name) {
|
|
|
|
|
const item = option.legend.data.find((item) => item.name === name);
|
|
|
|
|
// return `{a|${name}}{b|${( item.value / arrA * 100)}%}`;
|
|
|
|
|
return `{a|${name}}{pt|${item.pt}%}`;
|
|
|
|
|
},
|
|
|
|
|
textStyle: {
|
|
|
|
|
rich: {
|
|
|
|
|
a: {
|
|
|
|
|
'a': {
|
|
|
|
|
color: "#525966",
|
|
|
|
|
width: 60,
|
|
|
|
|
padding: [0, 0, 0, 5],
|
|
|
|
|
// padding: [0, 0, 0, 5],
|
|
|
|
|
},
|
|
|
|
|
b: {
|
|
|
|
|
'pt': {
|
|
|
|
|
color: "#495B7D",
|
|
|
|
|
fontWeight: "bold",
|
|
|
|
|
// width: 60,
|
|
|
|
|
width: 60,
|
|
|
|
|
// padding: [0, 0, 0, 10],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
formatter: function (name) {
|
|
|
|
|
const item = option.legend.data.find((item) => item.name === name);
|
|
|
|
|
// return `{a|${name}}{b|${( item.value / arrA * 100)}%}`;
|
|
|
|
|
return `{a|${name}}{b|${item.pt}%}`;
|
|
|
|
|
},
|
|
|
|
|
//将waiyuan的数据拿过来,就会只显示该外圆的数据
|
|
|
|
|
// data: [
|
|
|
|
|
// { value: 15, name: "张家港市" },
|
|
|
|
|