Example 102: Scientific Graph showing use of FastCopyFrom providng subset index

PesgoScientific Graph Objectbeginner

Use of FastCopyFrom providng subset index

Preview

ProEssentials Pesgo Scientific Graph Object - Scientific Graph showing use of FastCopyFrom providng subset index
Click to enlarge

Source Code

Form3.cs
1// This creates the SimpleGraph example chart //
2// The simple graph has 4 subsets with 120 points each//
3CreateSimpleSGraph(Pesgo1);
4
5// Repassing the data via FastCopyFrom / PEvsetEx, one subset at a time //
6float[] MyXData = new float[120];
7float[] MyYData = new float[120];
8int p;
9
10// Repass the first subset //
11for (p = 0; p <= 119; p++)
12{
13 MyXData[p] = (p + 1) * 30;
14 MyYData[p] = (float)(50 + (Rand_Num.NextDouble() * 100));
15}
16Pesgo1.PeData.X.FastCopyFrom(MyXData, 0, 120);
17Pesgo1.PeData.Y.FastCopyFrom(MyYData, 0, 120);
18
19// Repass the second subset //
20for (p = 0; p <= 119; p++)
21{
22 MyXData[p] = 300 + ((p + 50) * 30);
23 MyYData[p] = (float)(150 + (Rand_Num.NextDouble() * 100));
24}
25Pesgo1.PeData.X.FastCopyFrom(MyXData, 1, 120);
26Pesgo1.PeData.Y.FastCopyFrom(MyYData, 1, 120);
27
28//Repass the third subset //
29for (p = 0; p <= 119; p++)
30{
31 MyXData[p] = 600 + ((p + 100) * 30);
32 MyYData[p] = (float)(250 + (Rand_Num.NextDouble() * 100));
33}
34Pesgo1.PeData.X.FastCopyFrom(MyXData, 2, 120);
35Pesgo1.PeData.Y.FastCopyFrom(MyYData, 2, 120);
36
37//Repass the fourth subset //
38for (p = 0; p <= 119; p++)
39{
40 MyXData[p] = 900 + ((p + 150) * 30);
41 MyYData[p] = (float)(350 + (Rand_Num.NextDouble() * 100));
42}
43Pesgo1.PeData.X.FastCopyFrom(MyXData, 3, 120);
44Pesgo1.PeData.Y.FastCopyFrom(MyYData, 3, 120);
45
46// Set Various Other Properties ///
47Pesgo1.PePlot.Option.SolidLineOverArea = 1;
48
49Pesgo1.PeColor.BitmapGradientMode = true;
50Pesgo1.PeColor.QuickStyle = QuickStyle.DarkShadow;
51Pesgo1.PePlot.Method = SGraphPlottingMethod.Area;
52
53// Generally call ReinitializeResetImage at end **'
54Pesgo1.PeFunction.ReinitializeResetImage();
55Pesgo1.Invalidate();
56// Optionally call Pego1.Refresh() if you are not seeing changes immediately
Tip: Uses property syntax like Pego1.PeData.Y[s, p]Click underlined properties to view documentation