1 private void Button_Click(object sender, RoutedEventArgs e)
2 {
3 //Dia.Series.
4 List<SeriesPoint> PUCL = new List<SeriesPoint>();
5 List<SeriesPoint> PCL = new List<SeriesPoint>();
6 List<SeriesPoint> PLCL = new List<SeriesPoint>();
7 List<SeriesPoint> PValue = new List<SeriesPoint>();
8
9 List<int> X = new List<int>() {1,2,3,4,5,6,7,8,9,10 };
10 List<double> UCLY = new List<double>() { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };
11 List<double> CLY = new List<double>() { 3,3,3,3,3,3,3,3,3,3 };
12 List<double> LCLY = new List<double>() { 1,1,1,1,1,1,1,1,1,1 };
13 List<double> ValueY = new List<double>() {2.2,2.3,2.4,2.9,2.5,7.7,5.4,2.4,2.7,2.8 };
14
15 if (X.Count == UCLY.Count && CLY.Count == LCLY.Count && X.Count == LCLY.Count)
16 {
17 for (int i = 0; i < X.Count; i++)
18 {
19 PUCL.Add(new SeriesPoint() { Argument = X[i].ToString(), Value = UCLY[i] });
20 PCL.Add(new SeriesPoint() { Argument = X[i].ToString(), Value = CLY[i] });
21 PLCL.Add(new SeriesPoint() { Argument = X[i].ToString(), Value = LCLY[i] });
22 if (ValueY[i] > UCLY[i] || ValueY[i] < LCLY[i])
23 {
24 SeriesPoint point = new SeriesPoint()
25 {
26 Argument = X[i].ToString(),
27 Value = ValueY[i],
28 Brush = new SolidColorBrush(Color.FromRgb(255, 0, 0))
29 };
30 PValue.Add(point);
31 }
32 else
33 {
34 SeriesPoint point = new SeriesPoint()
35 {
36 Argument = X[i].ToString(),
37 Value = ValueY[i],
38 //Brush = new SolidColorBrush(Color.FromRgb(255, 0, 0))
39 };
40 PValue.Add(point);
41 }
42 }
43 }
44
45
46 UCL.Points.AddRange(PUCL);
47 CL.Points.AddRange(PCL);
48 LCL.Points.AddRange(PLCL);
49 Value.Points.AddRange(PValue);
50
51 }