public void AddSeries(ISeries s, ISeriesPainter painter) { if (parent != null) { parent.AddSeries(s, painter); return; } series.Add(s); painter.Performer = this; painters[s] = painter; foreach (ChartPerformer ch in children) { ISeriesPainter p = painter.Clone() as ISeriesPainter; ch.AddSeries(s, p); } }
/// <summary> /// Adds a performer /// </summary> /// <param name="performer">Performer to add</param> public void Add(ChartPerformer performer) { if (performer == this) { throw new Exception(); } if (performer.parent != null) { throw new Exception(); } children.Add(performer); performer.parent = this; foreach (ISeries s in painters.Keys) { performer.AddSeries(s, painters[s]); } }