This commit is contained in:
姚宇浩 2024-07-13 17:07:04 +08:00
parent 28c0308bbe
commit 4e8d96c6fe
1 changed files with 35 additions and 39 deletions

View File

@ -19,6 +19,7 @@ const data = reactive({
"rgba(82, 174, 255, 1)", "rgba(82, 174, 255, 1)",
], ],
}); });
const colorList = ['#ffd813', '#08daaa', '#6571fc','red'];
let datas = [ let datas = [
{ {
name: "高血压", name: "高血压",
@ -50,23 +51,9 @@ const getOption = () => {
fontSize: 16, fontSize: 16,
}, },
// left: "24%", //
// top: "38%", //
// subtext: `100%`, //
// subtextStyle: {
// //
// color: "#00FFFB",
// fontSize: 22,
// fontWeight: "bold",
// },
// textAlign: "center", //
}, },
// grid: {
// top: "13%",
// left: "1%",
// right: "1%",
// bottom: "0%",
// },
legend: { legend: {
itemHeight: 10, itemHeight: 10,
itemWidth: 25, itemWidth: 25,
@ -107,34 +94,43 @@ const getOption = () => {
}, },
tooltip: { tooltip: {
trigger: "item", trigger: "item",
formatter: "{b}:{d}", formatter: "{b}:{c}",
}, },
calculable: true,
series: [ series: [
{ {
name: "", type: 'pie',
type: "pie", radius: [0, 100],
// radius: ["45%", "90%"], center: ['50%', '40%'],
// center: ["25%", "50%"],
roseType: "radiuas", roseType: 'area',
labelLine: { itemStyle: {
normal: { color: (params) => {
length: 30, // 线 return colorList[params.dataIndex];
length2: 80, },
lineStyle: { borderRadius: 8,
color: "white", // 线
}, },
}, //
}, label: {
label: { show: true,
show: true, position: 'outside',
formatter: "{b}:{c}" + "个\n\n", formatter: '{a|{b}{c}}\n{hr|}',
borderWidth: 10, rich: {
borderRadius: 4, hr: {
padding: [0, -80],
}, backgroundColor: 'auto',
data: datas, borderRadius: 3,
width: 3,
height: 3,
padding: [3, 3, 0, -12],
},
a: {
padding: [-30, 15, -20, 15],
color: 'auto',
},
},
},
data: datas,
}, },
], ],
}; };