Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void drawChartPlots(int timeLayer, double[,] a, double[,] b,
- System.Windows.Forms.DataVisualization.Charting.Chart chart1)
- {
- if (a == null)
- return;
- chart1.ChartAreas.Clear();
- chart1.ChartAreas.Add("ChartArea1");
- while (chart1.Series.Count > 0)
- chart1.Series.RemoveAt(0);
- chart1.Series.Add("0");
- chart1.Series.Add("1");
- chart1.ChartAreas["ChartArea1"].AxisX.Minimum = 0;
- chart1.ChartAreas["ChartArea1"].AxisX.Maximum = Math.PI;
- chart1.ChartAreas["ChartArea1"].AxisY.Minimum = -0.5;
- chart1.ChartAreas["ChartArea1"].AxisY.Maximum = 2;
- chart1.Series["0"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
- chart1.Series["1"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
- chart1.Series["0"].Color = System.Drawing.Color.Red;
- chart1.Series["1"].Color = System.Drawing.Color.Blue;
- double x = 0;
- for (int i = 0; i <= Algorithms_lab2.N; i++)
- {
- chart1.Series["0"].Points.AddXY(x, a[timeLayer, i]);
- x += Algorithms_lab2.h;
- }
- x = 0;
- for (int i = 0; i <= Algorithms_lab2.N; i++)
- {
- chart1.Series["1"].Points.AddXY(x, b[timeLayer, i]);
- x += Algorithms_lab2.h;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement