void setChooser() { if (chooser != null) { Control c = chooser as Control; Control p = c.Parent; p.Controls.Remove(c); } IPointFactory f = draw.Factory; if (f == null) { return; } chooser = PointCollectionChooserFactory.Factory[f]; chooser.Consumer = draw; chooser.Measurements = draw.Measurements; Control control = chooser as Control; splitContainerMain.Panel2.Controls.Add(control); control.LoadResources(); if (performer.Count > 0) { performer.Remove(draw); } ISeriesPainter painter = f.GetPainter(performer); performer.AddSeries(draw, painter); performer.Resize(); performer.RefreshAll(); }
void setChooser() { if (chooser != null) { Control c = chooser as Control; Control p = c.Parent; p.Controls.Remove(c); } IPointFactory f = series.Factory; if (f == null) { return; } chooser = PointCollectionChooserFactory.Factory[f]; chooser.Consumer = series; chooser.Measurements = series.Measurements; Control control = chooser as Control; this.LoadResources(); panelParameters.Controls.Add(control); if (performer.Count > 0) { performer.Remove(series); } ISeriesPainter painter = f.GetPainter(performer); performer.AddSeries(series, painter); performer.Resize(); performer.RefreshAll(); }
void ShowChart() { Chart.ChartPerformer performer = userControlChart.Performer; performer.RemoveAll(); ISeriesPainter sp = painterInreface.Painter; if (sp != null) { DataPerformer.Series series = nc as DataPerformer.Series; SeriesGraph ser = new SeriesGraph(series); performer.AddSeries(ser, sp); } performer.RefreshAll(); }
internal void ShowInternal() { performer.RemoveAll(); if (painterInreface != null) { ISeriesPainter sp = painterInreface.Painter; if (sp != null) { SeriesGraph ser = new SeriesGraph(series); performer.AddSeries(ser, sp); } performer.RefreshAll(); } }
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> /// Paints itself /// </summary> public void Paint() { if (isBlocked) { return; } if (image == null) { return; } Brush brush = new SolidBrush(Bkgnd); Graphics gi = Graphics.FromImage(image); gi.FillRectangle(brush, 0, 0, image.Width, image.Height); if (IsNaN(false)) { return; } if (coordPainter != null) { coordPainter.DrawCoord(gi, dSize, size); } for (int i = 0; i < Count; i++) { ISeries s = this[i]; ISeriesPainter p = null; if (painters.ContainsKey(s)) { p = painters[s]; } else { p = new SimpleSeriesPainter(new Color[] { Color.Black }); p.Performer = this; painters[s] = p; } if (p != null) { p.Draw(s, gi); } } //drawHistograms(gi); gi.Dispose(); gi = Graphics.FromImage(iTemp); gi.DrawImage(image, 0, 0); gi.Dispose(); }
/// <summary> /// Selects painter /// </summary> /// <param name="mode">Mode</param> /// <param name="color">Color</param> /// <param name="performer">Performer</param> /// <returns>Painter</returns> static public ISeriesPainter SelectPainter(this string mode, Color[] color, ChartPerformer performer) { ISeriesPainter painter = null; if (mode.Equals(ResourceService.Resources.GetControlResource("Lines", DataPerformer.UI.Utils.ControlUtilites.Resources))) { painter = new SimpleSeriesPainter(color); } if (mode.Equals(ResourceService.Resources.GetControlResource("Crosses", DataPerformer.UI.Utils.ControlUtilites.Resources))) { painter = new CrossSeriesPainter(color); } if (painter != null) { painter.Performer = performer; } return(painter); }
/// <summary> /// Adds series /// </summary> /// <param name="series">Series to add</param> /// <param name="painter">Painter</param> public void AddSeries(ISeries series, ISeriesPainter painter) { performer.AddSeries(series, painter); RefreshAll(); }