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);
     }
     ResetSeriesIndex();
     SeriesHelper.UpdateSerieNameList(this, ref m_LegendRealShowName);
 }
        public bool ReplaceSerie(Serie oldSerie, Serie newSerie)
        {
            if (oldSerie == null || newSerie == null)
            {
                return(false);
            }

            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);
            ResetSeriesIndex();
            InitSerieHandlers();
            RefreshAllComponent();
            RefreshChart();
            return(true);
        }