From 51c07036702e8b6153ba11c48f04a44afe4b27f1 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Mon, 19 Jan 2026 22:13:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B2=E7=BA=BF=E5=9B=BE=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E8=BF=87=E5=A4=A7=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/other/index.vue | 54 ++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/src/components/other/index.vue b/src/components/other/index.vue index 658613c..1247d63 100644 --- a/src/components/other/index.vue +++ b/src/components/other/index.vue @@ -81,7 +81,7 @@ >参数设置 --> - + + {{ @@ -291,7 +291,7 @@ {{ setTitle }} --> - + @@ -761,7 +761,8 @@ const keepNightOpen = ref(false); /** -----------------method start----------------- */ Taro.useDidShow(() => { const sysInfo = Taro.getSystemInfoSync(); - let cWidth = (700 / 750) * sysInfo.screenWidth; + // 修改宽度计算:从 700/750 改为 680/750,为左右边距预留空间 + let cWidth = (680 / 750) * sysInfo.screenWidth; let cHeight = (220 / 750) * sysInfo.windowHeight; let pixelRatio = sysInfo.pixelRatio; chartConf.cWidth = cWidth; @@ -776,7 +777,8 @@ Taro.useDidShow(() => { }); onMounted(() => { const sysInfo = Taro.getSystemInfoSync(); - let cWidth = (700 / 750) * sysInfo.screenWidth; + // 修改宽度计算:从 700/750 改为 680/750,为左右边距预留空间 + let cWidth = (680 / 750) * sysInfo.screenWidth; let cHeight = (220 / 750) * sysInfo.windowHeight; let pixelRatio = sysInfo.pixelRatio; chartConf.cWidth = cWidth; @@ -1243,6 +1245,7 @@ function createCharts(x, series, ids) { fontColor: "#222222", itemGap: 10, position: "top", + float: "center", }, dataLabel: false, xAxis: { @@ -1337,6 +1340,7 @@ function createCharts(x, series, ids) { fontColor: "#222222", itemGap: 10, position: "top", + float: "center", }, dataLabel: false, xAxis: { @@ -1403,7 +1407,7 @@ function updateCharts(x, series, ids) { legend: { fontColor: "#222222", itemGap: 10, - float: prDev.value == 2 || prDev.value == 1 ? "left" : "center", + float: "center", }, xAxis: { disableGrid: true, @@ -1584,7 +1588,8 @@ function hideTour(a) { function refresh() { // 确保重新设置图表尺寸 const sysInfo = Taro.getSystemInfoSync(); - let cWidth = (700 / 750) * sysInfo.screenWidth; + // 修改宽度计算:从 700/750 改为 680/750,为左右边距预留空间 + let cWidth = (680 / 750) * sysInfo.screenWidth; let cHeight = (220 / 750) * sysInfo.windowHeight; let pixelRatio = sysInfo.pixelRatio; chartConf.cWidth = cWidth; @@ -1865,6 +1870,9 @@ defineExpose({