let Data = [{ value: 2459, name: "优秀" }, { value: 2453, name: "良好" }, { value: 1253, name: "一般" }, { value: 1865, name: "不及格" } ]; const colorList = [ new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ offset: 0, color: "rgba(69,233,254,1)" }, { offset: 1, color: "rgba(69,233,254,0.3)" } ]), new echarts.graphic.LinearGradient(1, 0, 0, 0, [{ offset: 0, color: "rgba(255,181,111,1)" }, { offset: 1, color: "rgba(255,181,111,0.3)" } ]), new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ offset: 0, color: "rgba(101,122,250,1)" }, { offset: 1, color: "rgba(101,122,250,0.3)" } ]), new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ offset: 0, color: "rgba(45,190,146,1)" }, { offset: 1, color: "rgba(45,190,146,0.3)" } ]) ]; option = { tooltip: { trigger: "item" }, legend: { type: "plain", orient: "vertical", left: "70%", top: "center", align: "left", itemGap: 10, itemWidth: 20, // 设置宽度 itemHeight: 20, // 设置高度] symbolKeepAspect: false, selectedMode: false, textStyle: { color: "#333333", fontSize: 14 } }, series: [{ type: "pie", hoverAnimation: true, hoverOffset: 25, startAngle: 180, //起始角度 clockwise: false, //是否顺时针 radius: ["45%", "66%"], center: ["30%", "50%"], avoidLabelOverlap: false, itemStyle: { color: params => { return colorList[params.dataIndex]; } }, emphasis: { label: { show: true, fontSize: "30", fontWeight: "bold", formatter: ["{a|占比 \n{d}%}"].join("\n"), rich: { a: { fontSize: 20, lineHeight: 36, color: "#333" }, b: { color: "#a7a9c7", fontSize: 16, lineHeight: 24, color: "#333" } } } }, label: { show: false, position: "center", color: "rgba(13, 17, 29,0)" }, labelLine: { show: false }, data: Data, zlevel: 30 }] };