public void Add(DataSeries ds) { dataSeriesList.Add(ds); if (ds.SeriesName == "") { ds.SeriesName = "DataSeries" + dataSeriesList.Count.ToString(); } }
private void AddData(Graphics g) { dc.DataSeriesList.Clear(); // Add data points to ds1: DataSeries ds1 = new DataSeries(); ds1.LineStyle.LineColor = Color.Red; ds1.LineStyle.Thickness = 2f; ds1.LineStyle.Pattern = DashStyle.Dash; ds1.SeriesName = "x1*cos(x1)"; for (int i = 0; i < 20; i++) { float x1 = 1.0f * i; float y1 = x1 * (float)Math.Cos(x1); ds1.AddPoint(new PointF(x1, y1)); } dc.Add(ds1); // Add data points to ds2: DataSeries ds2 = new DataSeries(); ds2.LineStyle.LineColor = Color.Blue; ds2.LineStyle.Thickness = 2f; ds2.SeriesName = "100 + 20*x2"; ds2.IsY2Data = true; for (int i = 5; i < 30; i++) { float x2 = 1.0f * i; float y2 = 100.0f + 20.0f*x2; ds2.AddPoint(new PointF(x2, y2)); } dc.Add(ds2); }
public void Insert(int dataSeriesIndex, DataSeries ds) { dataSeriesList.Insert(dataSeriesIndex, ds); if (ds.SeriesName == "") { dataSeriesIndex = dataSeriesIndex + 1; ds.SeriesName = "DataSeries" + dataSeriesIndex.ToString(); } }