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);