lijinlong^2
杜函宇 1 year ago
parent cc4af5720a
commit a8bfa0faea

@ -81,12 +81,6 @@ export default {
itemWidth: 10,
itemHeight: 10,
icon: "circle",
formatter(name) {
// const arrA = this.arr1.filter((value, index) => {
// return value.name == name;
// });
return `{a|${name}}{b|1%}`;
},
textStyle: {
rich: {
a: {
@ -101,6 +95,15 @@ export default {
},
},
},
formatter: function (name) {
console.log(option.legend);
let arrA = 0;
option.legend.data.forEach((value, index) => {
arrA += value.value;
});
const item = option.legend.data.find((item) => item.name === name);
return `{a|${name}}{b|${( item.value / arrA * 100)}%}`;
},
//waiyuan,
// data: [
// { value: 15, name: "" },
@ -118,44 +121,11 @@ export default {
},
series: [
{
type: "pie",
center: ["28%", "55%"], //
radius: ["42%", "65%"],
avoidLabelOverlap: false,
label: {
show: false,
},
emphasis: {
//
// label: {
// show: true,
// fontSize: 40,
// fontWeight: "bold",
// },
},
labelLine: {
show: false,
},
// data: [
// { value: 15, name: "" },
// { value: 10, name: "" },
// { value: 8, name: "" },
// { value: 10, name: "" },
// { value: 18, name: "" },
// { value: 6, name: "" },
// { value: 10, name: "" },
// { value: 4, name: "" },
// { value: 10, name: "" },
// { value: 5, name: "" },
// ],
data: this.arr1,
},
{
//
color: ["#F6F6F9"],
type: "pie",
center: ["28%", "55%"], //
radius: "32%",
color:'rgb(246,246,249)',
avoidLabelOverlap: false,
tooltip: {
show: false,
@ -193,8 +163,41 @@ export default {
},
data: [{ value: 1, name: "苏州完成率", pt: 100 }],
},
{
//
type: "pie",
center: ["28%", "55%"], //
radius: ["42%", "65%"],
avoidLabelOverlap: false,
label: {
show: false,
},
emphasis: {
//
// label: {
// show: true,
// fontSize: 40,
// fontWeight: "bold",
// },
},
labelLine: {
show: false,
},
// data: [
// { value: 15, name: "" },
// { value: 10, name: "" },
// { value: 8, name: "" },
// { value: 10, name: "" },
// { value: 18, name: "" },
// { value: 6, name: "" },
// { value: 10, name: "" },
// { value: 4, name: "" },
// { value: 10, name: "" },
// { value: 5, name: "" },
// ],
data: this.arr1,
},
],
};
option && myChart.setOption(option);
},

Loading…
Cancel
Save