public void Add(DataSeries ds) { dataSeriesList.Add(ds); if (ds.SeriesName == "") { ds.SeriesName = "DataSeries" + dataSeriesList.Count.ToString(); } }
void AddData(Graphics g) { float x, y; // Add first data series: dc.DataSeriesList.Clear(); ds = new DataSeries(); ds.BarStyle.BorderColor = Color.Red; ds.BarStyle.FillColor = Color.Green; for (int i = 0; i < 5; i++) { x = i + 1; y = 2f * x; ds.AddPoint (new CGPoint (x, y)); } dc.Add (ds); // Add second data series: ds = new DataSeries (); ds.BarStyle.BorderColor = Color.Red; ds.BarStyle.FillColor = Color.Yellow; for (int i = 0; i < 5; i++) { x = i + 1; y = 1.5f * x; ds.AddPoint (new CGPoint (x, y)); } dc.Add (ds); // Add third data series: ds = new DataSeries (); ds.BarStyle.BorderColor = Color.Red; ds.BarStyle.FillColor = Color.Blue; for (int i = 0; i < 5; i++) { x = i + 1; y = 1f * x; ds.AddPoint (new CGPoint(x, y)); } dc.Add (ds); }
public void Insert(int dataSeriesIndex, DataSeries ds) { dataSeriesList.Insert(dataSeriesIndex, ds); if (ds.SeriesName == string.Empty) { dataSeriesIndex = dataSeriesIndex + 1; ds.SeriesName = "DataSeries" + dataSeriesIndex.ToString (); } }