public void Add(DataSeries ds)
 {
     dataSeriesList.Add(ds);
     if (ds.SeriesName == "Default Name")
     {
         ds.SeriesName = "DataSeries" + dataSeriesList.Count.ToString();
     }
 }
 public void Insert(int dataSeriesIndex, DataSeries ds)
 {
     dataSeriesList.Insert(dataSeriesIndex, ds);
     if (ds.SeriesName == "Default Name")
     {
         dataSeriesIndex = dataSeriesIndex + 1;
         ds.SeriesName = "DataSeries" + dataSeriesIndex.ToString();
     }
 }
        public void AddData()
        {
            dc.DataSeriesList.Clear();
            // Add Sine data with 20 data point:
            DataSeries ds1 = new DataSeries();
            ds1.LineStyle.LineColor = Color.Red;
            ds1.LineStyle.Thickness = 2f;
            ds1.LineStyle.Pattern = DashStyle.Dash;
            for (int i = 0; i < 20; i++)
            {
                ds1.AddPoint(new PointF(i / 5.0f, (float)Math.Sin(i / 5.0f)));
            }
            dc.Add(ds1);

            // Add Cosine data with 40 data point:
            DataSeries ds2 = new DataSeries();
            ds2.LineStyle.LineColor = Color.Blue;
            ds2.LineStyle.Thickness = 1f;
            ds2.LineStyle.Pattern = DashStyle.Solid;
            for (int i = 0; i < 40; i++)
            {
                ds2.AddPoint(new PointF(i / 5.0f, (float)Math.Cos(i / 5.0f)));
            }
            dc.Add(ds2);
        }