public void Add(DataSeries ds)
 {
     dataSeriesList.Add (ds);
     if (ds.SeriesName == "") {
         ds.SeriesName = "DataSeries" + dataSeriesList.Count.ToString ();
     }
 }
        private void AddData()
        {
            dc.DataSeriesList.Clear();
            // Add log-sine data:
            DataSeries ds = new DataSeries();
            ds.LineStyle.LineColor = Color.Red;
            ds.LineStyle.Thickness = 1f;
            ds.LineStyle.Pattern = DashStyle.Solid;
            ds.SeriesName = "Sin(theta)";
            for (int i = 0; i < 360; i++)
            {
                float theta = 1.0f * i;
                float r = (float)Math.Log(1.001f + Math.Sin(2 * theta * Math.PI / 180));
                ds.AddPoint(new PointF(theta, r));
            }
            dc.Add(ds);

            // Add log-cosine data:
            ds = new DataSeries();
            ds.LineStyle.LineColor = Color.Green;
            ds.LineStyle.Thickness = 1f;
            ds.LineStyle.Pattern = DashStyle.Solid;
            ds.SeriesName = "Cos(theta)";
            for (int i = 0; i < 360; i++)
            {
                float theta = 1.0f * i;
                float r = (float)Math.Log(1.001f + Math.Cos(2 * theta * Math.PI / 180));
                ds.AddPoint(new PointF(theta, r));
            }
            dc.Add(ds);

            /*ds = new DataSeries();
            ds.LineStyle.LineColor = Color.Red;
            for (int i = 0; i < 360; i++)
            {
                float theta = 1.0f * i;
                float r = (float)Math.Abs(Math.Cos(2*theta * Math.PI / 180) *
                    Math.Sin(2 * theta * Math.PI / 180));
                ds.AddPoint(new PointF(theta, r));
            }
            dc.Add(ds);*/
        }
 public void Insert(int dataSeriesIndex, DataSeries ds)
 {
     dataSeriesList.Insert (dataSeriesIndex, ds);
     if (ds.SeriesName == "") {
         dataSeriesIndex = dataSeriesIndex + 1;
         ds.SeriesName = "DataSeries" + dataSeriesIndex.ToString ();
     }
 }