private void popList1_Selected(object sender, EventArgs e) { switch (popList1.Selections[0].Text) { case "DataBind": DataBind(); break; case "XAxis": this.lineChart1.XAxis.XOffset = 1; this.lineChart1.XAxis.YOffset = 1; this.lineChart1.XAxis.TextSize = 10; this.lineChart1.XAxis.TextColor = System.Drawing.Color.Red; this.lineChart1.XAxis.DrawAxisLine = false; this.lineChart1.XAxis.DrawGridLines = false; this.lineChart1.XAxis.DrawLabels = false; this.lineChart1.XAxis.GridLineWidth = 5; this.lineChart1.XAxis.AxisLineWidth = 5; this.lineChart1.XAxis.GridColor = System.Drawing.Color.Blue; this.lineChart1.XAxis.AxisLineColor = System.Drawing.Color.Gray; this.lineChart1.XAxis.Position = XAxisPosition.TOP; break; case "AddSet": this.lineChart1.Data.AddSeries(GetNewSerie(this.lineChart1.Data)); break; case "RemoveSet": if (this.lineChart1.Data.SeriesCount > 0) { this.lineChart1.Data.RemoveSeries(0); } break; case "ClearSet": this.lineChart1.Data.ClearValues(); break; case "SetData": List <string> xLabels = new List <string>(); xLabels.AddRange(new string[] { "1", "2", "3", "4" }); LineData data = new LineData(xLabels); data.AddSeries(GetNewSerie(data)); this.lineChart1.Data = data; break; } }