样式调整

This commit is contained in:
zhujiyan
2024-09-02 16:10:33 +08:00
parent ed0a7efd51
commit dc7a9e7bd2
7 changed files with 376 additions and 337 deletions

View File

@@ -41,7 +41,7 @@ const init = () => {
isRing: false, //是否环形图
isRadius: false, //是否圆角
isSpace: true, //是否显示间隔
isLabelLine: true, //是否显示引导线
isLabelLine: false, //是否显示引导线
...props.customData,
};
legendData.value = {
@@ -51,7 +51,7 @@ const init = () => {
itemGap: 0, // 设置图例项之间的间隔为20
...props.legendData,
};
chart.value = chartsRef.value && echarts.init(chartsRef.value)
chart.value = chartsRef.value && echarts.init(chartsRef.value);
var option = {
title: {
text: customData.value.title,
@@ -67,7 +67,7 @@ const init = () => {
series: [
{
type: "pie",
radius: customData.value.isRing ? ["45", "65"] : "65%",
radius: customData.value.isRing ? ["55", "75"] : "75%",
data: props.chartsData,
center: ["55%", "50%"], // 设置饼图的中心位置
// padAngle: 2,
@@ -80,6 +80,16 @@ const init = () => {
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
label: {
normal: {
show: true,
position: "inside",
textStyle: {
color: "#fff",
fontSize: 12,
},
},
},
itemStyle: {
borderRadius: customData.value.isRadius ? 10 : 0,
borderColor: customData.value.isSpace ? "#fff" : "",
@@ -91,7 +101,7 @@ const init = () => {
},
],
};
option &&chart.value&& chart.value.setOption(option);
option && chart.value && chart.value.setOption(option);
setTimeout(() => {
chart.value.resize();
}, 0);