This commit is contained in:
monitor1394
2022-03-16 13:41:26 +08:00
parent d6c45aaf6b
commit 407b3625d7
5 changed files with 84 additions and 14 deletions

View File

@@ -26,6 +26,7 @@ namespace XCharts.Runtime
public void InsertSerie(Serie serie, int index = -1, bool addToHead = false)
{
serie.AnimationRestart();
AnimationStyleHelper.UpdateSerieAnimation(serie);
if (addToHead) m_Series.Insert(0, serie);
else if (index >= 0) m_Series.Insert(index, serie);
else m_Series.Add(serie);
@@ -180,7 +181,7 @@ namespace XCharts.Runtime
var index = m_Series.IndexOf(oldSerie);
if (index < 0)
return false;
AnimationStyleHelper.UpdateSerieAnimation(newSerie);
oldSerie.OnRemove();
m_Series.RemoveAt(index);
m_Series.Insert(index, newSerie);

View File

@@ -220,7 +220,7 @@ namespace XCharts.Runtime
{
m_Theme.sharedTheme = XCThemeMgr.GetTheme(ThemeType.Default);
}
if (m_CheckTheme != m_Theme.themeType)
if (m_Theme.sharedTheme != null && m_CheckTheme != m_Theme.themeType)
{
m_CheckTheme = m_Theme.themeType;
m_Theme.sharedTheme.CopyTheme(m_CheckTheme);
@@ -536,7 +536,8 @@ namespace XCharts.Runtime
serie.context.colorIndex = GetLegendRealShowNameIndex(serie.legendName);
serie.context.dataPoints.Clear();
serie.context.dataIgnores.Clear();
AnimationStyleHelper.UpdateSerieAnimation(serie);
serie.animation.context.isAllItemAnimationEnd = true;
if (m_OnDrawSerieBefore != null)
{
m_OnDrawSerieBefore.Invoke(vh, serie);