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)",
],
});
const colorList = ['#ffd813', '#08daaa', '#6571fc','red'];
let datas = [
{
name: "高血压",
@ -50,23 +51,9 @@ const getOption = () => {
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: {
itemHeight: 10,
itemWidth: 25,
@ -107,33 +94,42 @@ const getOption = () => {
},
tooltip: {
trigger: "item",
formatter: "{b}:{d}",
formatter: "{b}:{c}",
},
calculable: true,
series: [
{
name: "",
type: "pie",
// radius: ["45%", "90%"],
// center: ["25%", "50%"],
type: 'pie',
radius: [0, 100],
center: ['50%', '40%'],
roseType: "radiuas",
labelLine: {
normal: {
length: 30, // 线
length2: 80,
lineStyle: {
color: "white", // 线
},
roseType: 'area',
itemStyle: {
color: (params) => {
return colorList[params.dataIndex];
},
borderRadius: 8,
},
//
label: {
show: true,
formatter: "{b}:{c}" + "个\n\n",
borderWidth: 10,
borderRadius: 4,
padding: [0, -80],
position: 'outside',
formatter: '{a|{b}{c}}\n{hr|}',
rich: {
hr: {
backgroundColor: 'auto',
borderRadius: 3,
width: 3,
height: 3,
padding: [3, 3, 0, -12],
},
a: {
padding: [-30, 15, -20, 15],
color: 'auto',
},
},
},
data: datas,
},
],