Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.Windows.Forms.DataVisualization.Charting.Chart chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
- this.Controls.Add(chart1);
- chart1.ChartAreas.Add("area");
- int[] x = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
- int[] y = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
- for (int i = 1; i <= 20; i++)
- {
- chart1.Series.Add("series" + i.ToString());
- chart1.Series["series" + i.ToString()].Color = Color.FromArgb(255 - y[i] * 20, 0, 255 - y[i] * 10);
- chart1.Series["series" + i.ToString()].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
- chart1.Series["series" + i.ToString()].Points.AddXY(x[i-1], y[i-1]);
- chart1.Series["series" + i.ToString()].Points.AddXY(x[i], y[i]);
- }
- if (y[i] >= 7)
- chart1.Series["series" + i.ToString()].Color = Color.Red;
- else
- chart1.Series["series" + i.ToString()].Color = Color.Blue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement