want to achieve the following functions
data in echerts pie chart legend always corresponds to name in data in series,
the following is the code
let option = {
title : {
text: "(180)",
subtext: "",
x:"center"
},
tooltip : {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
top: "40%",
right: "right",
formatter: {name},
data: ["","","","",""]
},
series : [
{
name: "",
type: "pie",
radius : "55%",
center: ["50%", "60%"],
data:[
{value:335, name:""},
{value:310, name:""},
{value:234, name:""},
{value:135, name:""},
{value:1548, name:""}
],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
};