增加Serie的totalDataIndex

This commit is contained in:
monitor1394
2023-09-03 22:31:00 +08:00
parent 367844a86c
commit 2a815e54db
3 changed files with 7 additions and 5 deletions

View File

@@ -1330,6 +1330,7 @@ namespace XCharts.Runtime
else
m_Data.Add(serieData);
serieData.OnAdd(animation);
context.totalDataIndex++;
SetVerticesDirty();
dataDirty = true;
m_NeedUpdateFilterData = true;

View File

@@ -118,5 +118,6 @@ namespace XCharts.Runtime
public Tooltip.Type tooltipType;
public Tooltip.Trigger tooltipTrigger;
public int totalDataIndex;
}
}

View File

@@ -38,8 +38,7 @@ namespace XCharts.Runtime
public virtual void UpdateTooltipSerieParams(int dataIndex, bool showCategory,
string category, string marker,
string itemFormatter, string numericFormatter, string ignoreDataDefaultContent,
ref List<SerieParams> paramList, ref string title)
{ }
ref List<SerieParams> paramList, ref string title) { }
public virtual void OnLegendButtonClick(int index, string legendName, bool show) { }
public virtual void OnLegendButtonEnter(int index, string legendName) { }
public virtual void OnLegendButtonExit(int index, string legendName) { }
@@ -224,6 +223,7 @@ namespace XCharts.Runtime
public override void InitComponent()
{
m_InitedLabel = false;
serie.context.totalDataIndex = serie.dataCount - 1;
InitRoot();
InitSerieLabel();
InitSerieTitle();