[fix] fix InsertSerie()

This commit is contained in:
monitor1394
2022-09-21 07:18:54 +08:00
parent 95c0bcdb75
commit eba8986f18
2 changed files with 6 additions and 12 deletions

View File

@@ -19,7 +19,9 @@ namespace XCharts.Runtime
public T InsertSerie<T>(int index, string serieName = null, bool show = true) where T : Serie
{
if (!CanAddSerie<T>()) return null;
return InsertSerie(index, typeof(T), serieName, show) as T;
var serie = InsertSerie(index, typeof(T), serieName, show) as T;
InitSerieHandlers();
return serie;
}
public void InsertSerie(Serie serie, int index = -1, bool addToHead = false)
@@ -30,9 +32,7 @@ namespace XCharts.Runtime
else if (index >= 0) m_Series.Insert(index, serie);
else m_Series.Add(serie);
ResetSeriesIndex();
InitSerieHandlers();
SeriesHelper.UpdateSerieNameList(this, ref m_LegendRealShowName);
RefreshChart();
}
public bool MoveUpSerie(int serieIndex)