diff --git a/src/page/index/components/BusinessStructure/BusinessStructure.vue b/src/page/index/components/BusinessStructure/BusinessStructure.vue index c44a508..7528e8c 100644 --- a/src/page/index/components/BusinessStructure/BusinessStructure.vue +++ b/src/page/index/components/BusinessStructure/BusinessStructure.vue @@ -47,6 +47,14 @@ const handleGoMounted = async () => { myChart = echarts.init(chartDom); + const rect = chartDom.getBoundingClientRect(); + const width = rect.width; + const height = rect.height; + + // 计算center位置(20%,50%)对应的实际像素 + const centerX = width * 0.2; + const centerY = height * 0.5; + const option = { tooltip: { // 新增 tooltip 配置 @@ -69,8 +77,8 @@ const handleGoMounted = async () => { width: 83, height: 83 }, - left: 31, - top: 24, + left: centerX - 41.5, + top: centerY - 41.5, z: 10 } ] diff --git a/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue b/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue index e51a9d1..2a697eb 100644 --- a/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue +++ b/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue @@ -1,7 +1,7 @@