From fb841a349800e1fd2e1a4e05cb3cdc28d1c1e6db Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 5 Nov 2025 22:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Axis`=E7=9A=84`indicatorLabe?= =?UTF-8?q?l`=E6=97=A0=E6=B3=95=E9=9A=90=E8=97=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/Component/Tooltip/TooltipHandler.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 3b322a69..c8d5f5cc 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -80,6 +80,7 @@ slug: /changelog ## master +* (2025.11.05) 修复`Axis`的`indicatorLabel`无法隐藏的问题 * (2025.11.03) 增加`Tooltip`的`Title`可通过`TitleLabelStyle`的`numericFormatter`格式化时间显示 (#353) * (2025.10.30) 增加`Chart`的`useUtc`参数设置显示时间是否用UTC时间 * (2025.10.30) 优化`Candlestick`对时间轴的支持 diff --git a/Runtime/Component/Tooltip/TooltipHandler.cs b/Runtime/Component/Tooltip/TooltipHandler.cs index 16de25e4..90a5740d 100644 --- a/Runtime/Component/Tooltip/TooltipHandler.cs +++ b/Runtime/Component/Tooltip/TooltipHandler.cs @@ -255,6 +255,11 @@ namespace XCharts.Runtime { if (label == null) return; if (double.IsNaN(axis.context.pointerValue)) return; + if (!axis.show || !axis.indicatorLabel.show) + { + label.SetActive(false, false); + return; + } label.SetActive(true, true); label.SetTextActive(true); label.SetPosition(axis.context.pointerLabelPosition + axis.indicatorLabel.offset); @@ -732,6 +737,7 @@ namespace XCharts.Runtime private void DrawXAxisIndicator(VertexHelper vh, Tooltip tooltip, GridCoord grid) { + if (!tooltip.lineStyle.show) return; var xAxes = chart.GetChartComponents(); var lineType = tooltip.lineStyle.GetType(chart.theme.tooltip.lineType); var lineWidth = tooltip.lineStyle.GetWidth(chart.theme.tooltip.lineWidth);