样式调整

This commit is contained in:
GYYM
2024-12-04 21:36:12 +08:00
parent aa86c5e662
commit a415ffa12a
9 changed files with 239 additions and 142 deletions

View File

@@ -49,7 +49,21 @@ const init = () => {
text: customData.value.title,
left: customData.value.textAlign,
},
legend: legendData.value,
legend:legendData.value,
// legend: {
// icon: legendData.value.icon, // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon)
// orient: "vertical", //图例排列方向
// left: legendData.value.left, //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值,
// itemGap: 1, // 设置图例项之间的间隔为20
// formatter: function (name) {
// const item = props.chartsData.filter(item=>item.name==name)
// console.log(item)
// if(item)
// return item[0].value;
// },
// },
tooltip: {
show: true,
trigger: "item",
@@ -61,6 +75,12 @@ const init = () => {
type: "pie",
radius: customData.value.isRing ? ["55", "75"] : "80%",
data: props.chartsData,
formatter: function (name) {
const item = props.chartsData.filter(item=>item.name==name)
console.log(item)
if(item)
return item[0].value;
},
center: ["55%", "50%"], // 设置饼图的中心位置
// padAngle: 2,
minAngle: 15, //最小角度
@@ -75,11 +95,14 @@ const init = () => {
label: {
normal: {
show: true,
position: "inside",
position: "outside",
textStyle: {
color: "#fff",
//color: "#fff",
fontSize: 12,
},
formatter: function (data) {
return data.value
}
},
},
itemStyle: {