diff --git a/src/pages/overview/_components/pie-chart.vue b/src/pages/overview/_components/pie-chart.vue index ec8e2af..f1279b6 100644 --- a/src/pages/overview/_components/pie-chart.vue +++ b/src/pages/overview/_components/pie-chart.vue @@ -61,6 +61,7 @@ const initChart = () => { type: 'pie', radius: ['40%', '70%'], // avoidLabelOverlap: false, + top: '20%', itemStyle: { borderRadius: 10 @@ -70,6 +71,8 @@ const initChart = () => { position: 'center' }, emphasis: { + scale: true, + scaleSize: 5, itemStyle: { shadowBlur: 10, shadowOffsetX: 0, @@ -79,9 +82,9 @@ const initChart = () => { labelLine: { show: true }, - hoverOffset: 15, // 增加悬停偏移量 + // hoverOffset: 15, // 增加悬停偏移量 still: false, // 允许悬浮动画 - silent: true, // 启用交互 + cursor: 'pointer', // 添加响应阈值配置 hoverAnimationThreshold: 1, // 无论多小的区块都可交互 selectedOffset: 10, // 选中项偏移量 @@ -94,7 +97,8 @@ const initChart = () => { onMounted(() => { // 延迟初始化确保DOM就绪 setTimeout(initChart, 0) - window.addEventListener('resize', initChart) + // window.addEventListener('resize', initChart) + window.addEventListener('resize', initChart); }) onUnmounted(() => { @@ -103,6 +107,7 @@ onUnmounted(() => { chartInstance = null } window.removeEventListener('resize', initChart) + }) // 数据变化时更新 @@ -120,9 +125,13 @@ watch(() => props.data, () => { \ No newline at end of file