public void Add(DataSeries ds)
 {
     dataSeriesList.Add(ds);
     if (ds.SeriesName == "")
     {
         ds.SeriesName = "DataSeries" + dataSeriesList.Count.ToString();
     }
 }
 public void Insert(int dataSeriesIndex, DataSeries ds)
 {
     dataSeriesList.Insert(dataSeriesIndex, ds);
     if (ds.SeriesName == "")
     {
         dataSeriesIndex = dataSeriesIndex + 1;
         ds.SeriesName = "DataSeries" + dataSeriesIndex.ToString();
     }
 }
        private 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 = 2.0f * x;
                ds.AddPoint(new PointF(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 PointF(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 = 1.0f * x;
                ds.AddPoint(new PointF(x, y));
            }
            dc.Add(ds);
        }