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({