ChartArea chartArea1 = new ChartArea(); chartArea1.Name = "ChartArea1"; chartArea1.BackColor = Color.White; chartArea1.AxisX.Title = "X-Axis"; chartArea1.AxisY.Title = "Y-Axis";
ChartArea chartArea2 = new ChartArea(); chartArea2.Name = "ChartArea2"; chartArea2.AxisX.Minimum = -10; chartArea2.AxisX.Maximum = 10; chartArea2.AxisY.Minimum = -5; chartArea2.AxisY.Maximum = 5; Series series1 = new Series(); series1.ChartType = SeriesChartType.Line; series1.Points.DataBindXY(new[] { -10, -5, 0, 5, 10 }, new[] { -1, -2, 3, 4, -5 }); series1.ChartArea = "ChartArea2"; Series series2 = new Series(); series2.ChartType = SeriesChartType.Spline; series2.Points.DataBindXY(new[] { -10, -5, 0, 5, 10 }, new[] { 2, 3, -1, 0, 1 }); series2.ChartArea = "ChartArea2";In conclusion, the System.Windows.Forms.DataVisualization.Charting.ChartArea class is an essential tool for creating charts in the C# programming language. It provides developers with the ability to customize the appearance of their charts, set ranges, and define series types. The library where this class can be found is the System.Windows.Forms.DataVisualization.Charting package.