From 549ee43a37422f7f3f05dbfe93fa5640cd817f9f Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 11 Jun 2024 08:11:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Tooltip`=E5=9C=A8`Cross`?= =?UTF-8?q?=E6=97=B6`Axis`=E7=9A=84`IndicatorLabel`=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98=20(#315)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 3 ++- Runtime/Internal/BaseChart.cs | 16 +++++++++++++++- Runtime/Internal/Basic/MainComponent.cs | 1 + Runtime/Serie/SerieHandler.cs | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index fba2d36d..68d6a564 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -73,7 +73,8 @@ slug: /changelog ## master -* (2024.06.09) 调整`Tooltip`的`Corss`重命名为`Cross` +* (2024.06.11) 修复`Tooltip`在`Cross`时`Axis`的`IndicatorLabel`可能不显示的问题 (#315) +* (2024.06.10) 调整`Tooltip`的`Corss`重命名为`Cross` * (2024.06.09) 增加`Axis`的`minCategorySpacing`设置类目轴默认的最小类目间距 * (2024.06.09) 修复`Tooltip`的`Cross`在`Axis`是类目轴并且开启`DataZoom`的情况下指示位置不准确的问题 * (2024.06.06) 修复`Serie`在`Clone`时动画异常问题 (#320) diff --git a/Runtime/Internal/BaseChart.cs b/Runtime/Internal/BaseChart.cs index e8353ce5..a347d270 100644 --- a/Runtime/Internal/BaseChart.cs +++ b/Runtime/Internal/BaseChart.cs @@ -124,9 +124,15 @@ namespace XCharts.Runtime base.InitComponent(); SeriesHelper.UpdateSerieNameList(this, ref m_LegendRealShowName); foreach (var handler in m_ComponentHandlers) + { handler.InitComponent(); + handler.inited = true; + } foreach (var handler in m_SerieHandlers) + { handler.InitComponent(); + handler.inited = true; + } m_DebugInfo.Init(this); } @@ -216,7 +222,15 @@ namespace XCharts.Runtime foreach (var handler in m_SerieHandlers) handler.BeforeUpdate(); foreach (var handler in m_ComponentHandlers) handler.BeforceSerieUpdate(); foreach (var handler in m_SerieHandlers) handler.Update(); - foreach (var handler in m_ComponentHandlers) handler.Update(); + foreach (var handler in m_ComponentHandlers) + { + if (!handler.inited) + { + handler.InitComponent(); + handler.inited = true; + } + handler.Update(); + } foreach (var handler in m_SerieHandlers) handler.AfterUpdate(); m_DebugInfo.Update(); diff --git a/Runtime/Internal/Basic/MainComponent.cs b/Runtime/Internal/Basic/MainComponent.cs index ae7798b7..843b7049 100644 --- a/Runtime/Internal/Basic/MainComponent.cs +++ b/Runtime/Internal/Basic/MainComponent.cs @@ -93,6 +93,7 @@ namespace XCharts.Runtime public int order { get; internal set; } public BaseChart chart { get; internal set; } public ComponentHandlerAttribute attribute { get; internal set; } + public bool inited { get; internal set; } public virtual void InitComponent() { } public virtual void RemoveComponent() { } diff --git a/Runtime/Serie/SerieHandler.cs b/Runtime/Serie/SerieHandler.cs index b750ef6e..e8983309 100644 --- a/Runtime/Serie/SerieHandler.cs +++ b/Runtime/Serie/SerieHandler.cs @@ -10,6 +10,7 @@ namespace XCharts.Runtime { public BaseChart chart { get; internal set; } public SerieHandlerAttribute attribute { get; internal set; } + public bool inited { get; internal set; } public virtual int defaultDimension { get; internal set; } public virtual void InitComponent() { }