修复AxisindicatorLabel无法隐藏的问题

This commit is contained in:
monitor1394
2025-11-05 22:49:23 +08:00
parent ac41dd1d07
commit fb841a3498
2 changed files with 7 additions and 0 deletions

View File

@@ -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<XAxis>();
var lineType = tooltip.lineStyle.GetType(chart.theme.tooltip.lineType);
var lineWidth = tooltip.lineStyle.GetWidth(chart.theme.tooltip.lineWidth);