-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
186 lines (147 loc) · 8.3 KB
/
MainWindow.xaml.cs
File metadata and controls
186 lines (147 loc) · 8.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
using Gigasoft.ProEssentials;
using Gigasoft.ProEssentials.Enums;
using System.Windows;
using System.Windows.Media;
namespace ProEssentialsWpfQuickstart
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public static Random Rand_Num = new Random(unchecked((int)DateTime.Now.Ticks));
public MainWindow()
{
InitializeComponent();
Pesgo1.Loaded += new RoutedEventHandler(Pesgo1_Loaded);
}
// control_Loaded Event
void Pesgo1_Loaded(object sender, RoutedEventArgs e)
{
Pesgo1.PeFont.SizeGlobalCntl = 1.1F;
//100 *** Simple Scientific Graph ***
//! Right button click to show popup menu. //
//! Double Click to show customization dialog. //
//! Left-Click and drag to draw zoom box. Use popup memu or 'z' to undo zoom. //
// Simple example show the basics of a scientific graph object. //
// Scientific Graph's contain both YData and XData and thus data
// is not plotted equally spaced as the graph object does.
// RenderSizeXdpi is unique to WPF interfaces.
// Default is true, results in sharpest lines all the time.
// Setting false and running on system without 100% TextSize (i.e. 125% or 150% text size) will result in fuzzier lines and text
// as everything will be scaled larger. Some may prefer the slight fuzziness of fully scaled results but we prefer the sharper images.
// Pesgo1.RenderSizeXdpi = true;
Pesgo1.PeUserInterface.Cursor.PromptTracking = true;
Pesgo1.PeUserInterface.Cursor.PromptLocation = CursorPromptLocation.ToolTip;
Pesgo1.PeUserInterface.Cursor.PromptStyle = CursorPromptStyle.XYValues;
// Enable Bar Glass Effect //
Pesgo1.PePlot.Option.BarGlassEffect = true;
// Enable Plotting style gradient and bevel features //
Pesgo1.PePlot.Option.AreaGradientStyle = PlotGradientStyle.VerticalAscentInverse;
Pesgo1.PePlot.Option.AreaBevelStyle = BevelStyle.MediumSmooth;
Pesgo1.PePlot.Option.SplineGradientStyle = PlotGradientStyle.VerticalAscentInverse;
Pesgo1.PePlot.Option.SplineBevelStyle = SplineBevelStyle.MediumSmooth;
Pesgo1.PePlot.Option.PointGradientStyle = PlotGradientStyle.VerticalAscentInverse;
Pesgo1.PeColor.PointBorderColor = Color.FromArgb(100, 0, 0, 0);
Pesgo1.PePlot.Option.LineSymbolThickness = 3;
Pesgo1.PePlot.Option.AreaBorder = 1;
// Prepare images in memory //
Pesgo1.PeConfigure.PrepareImages = true;
// Pass Data //
Pesgo1.PeData.Subsets = 4;
Pesgo1.PeData.Points = 120;
for (int s = 0; s <= 3; s++)
{
int nOffset = (int)(Rand_Num.NextDouble() * 250);
for (int p = 0; p <= 119; p++)
{
Pesgo1.PeData.X[s, p] = (float)((p + 1) * 100.0F);
Pesgo1.PeData.Y[s, p] = (float)((p + 1) * 1 + (Rand_Num.NextDouble() * 250)) + (float)(Math.Sin(((double)(nOffset + p)) * .03F) * 700.0F) - ((s * 140.0F));
}
}
// Set DataShadows to show 3D //
Pesgo1.PePlot.DataShadows = DataShadows.Shadows;
Pesgo1.PeUserInterface.Allow.FocalRect = false;
Pesgo1.PePlot.Method = SGraphPlottingMethod.PointsPlusSpline;
Pesgo1.PeGrid.LineControl = GridLineControl.Both;
Pesgo1.PeGrid.Style = GridStyle.Dot;
Pesgo1.PeUserInterface.Allow.Zooming = AllowZooming.HorzAndVert;
Pesgo1.PeUserInterface.Allow.ZoomStyle = ZoomStyle.Ro2Not;
// Enable middle mouse dragging //
Pesgo1.PeUserInterface.Scrollbar.MouseDraggingX = true;
Pesgo1.PeUserInterface.Scrollbar.MouseDraggingY = true;
Pesgo1.PeString.MainTitle = "Test Results";
Pesgo1.PeString.SubTitle = "";
Pesgo1.PeString.YAxisLabel = "Performance";
Pesgo1.PeString.XAxisLabel = "Duration";
// subset labels //
Pesgo1.PeString.SubsetLabels[0] = "Horsepower";
Pesgo1.PeString.SubsetLabels[1] = "Torque";
Pesgo1.PeString.SubsetLabels[2] = "Temperature";
Pesgo1.PeString.SubsetLabels[3] = "Pressure";
// subset colors //
Pesgo1.PeColor.SubsetColors[0] = Color.FromArgb(255, 213, 0, 69);
Pesgo1.PeColor.SubsetColors[1] = Color.FromArgb(255, 63, 200, 0);
Pesgo1.PeColor.SubsetColors[2] = Color.FromArgb(255, 212, 168, 0);
Pesgo1.PeColor.SubsetColors[3] = Color.FromArgb(255, 169, 0, 153);
// subset line types
Pesgo1.PeLegend.SubsetLineTypes[0] = LineType.MediumSolid;
Pesgo1.PeLegend.SubsetLineTypes[1] = LineType.MediumSolid;
Pesgo1.PeLegend.SubsetLineTypes[2] = LineType.MediumSolid;
Pesgo1.PeLegend.SubsetLineTypes[3] = LineType.MediumSolid;
// subset point types
Pesgo1.PeLegend.SubsetPointTypes[0] = PointType.DotSolid;
Pesgo1.PeLegend.SubsetPointTypes[1] = PointType.UpTriangleSolid;
Pesgo1.PeLegend.SubsetPointTypes[2] = PointType.SquareSolid;
Pesgo1.PeLegend.SubsetPointTypes[3] = PointType.DownTriangleSolid;
Pesgo1.PeLegend.SubsetPointTypes[4] = PointType.DotSolid;
Pesgo1.PeLegend.SubsetPointTypes[5] = PointType.SquareSolid;
Pesgo1.PeLegend.SubsetPointTypes[6] = PointType.DiamondSolid;
Pesgo1.PeLegend.SubsetPointTypes[7] = PointType.UpTriangleSolid;
Pesgo1.PeLegend.SimplePoint = true;
Pesgo1.PeLegend.SimpleLine = true;
Pesgo1.PeLegend.Style = LegendStyle.OneLine;
Pesgo1.PeGrid.Option.MultiAxisStyle = MultiAxisStyle.SeparateAxes;
Pesgo1.PePlot.Option.GradientBars = 8;
Pesgo1.PeConfigure.TextShadows = TextShadows.BoldText;
Pesgo1.PeFont.MainTitle.Bold = true;
Pesgo1.PeFont.SubTitle.Bold = true;
Pesgo1.PeFont.Label.Bold = true;
Pesgo1.PePlot.Option.LineShadows = true;
Pesgo1.PeFont.FontSize = Gigasoft.ProEssentials.Enums.FontSize.Large;
Pesgo1.PeUserInterface.Scrollbar.ScrollingHorzZoom = true;
Pesgo1.PeData.Precision = DataPrecision.OneDecimal;
// Various other features //
Pesgo1.PeFont.Fixed = true;
Pesgo1.PeColor.BitmapGradientMode = false;
Pesgo1.PeColor.QuickStyle = QuickStyle.DarkNoBorder;
Pesgo1.PeGrid.Configure.AutoMinMaxPadding = 1;
Pesgo1.PeConfigure.ImageAdjustLeft = 20;
Pesgo1.PeConfigure.ImageAdjustRight = 20;
Pesgo1.PeConfigure.ImageAdjustTop = 10;
// Set various export defaults //
Pesgo1.PeSpecial.DpiX = 600;
Pesgo1.PeSpecial.DpiY = 600;
// default export setting //
Pesgo1.PeUserInterface.Dialog.ExportSizeDef = ExportSizeDef.NoSizeOrPixel;
Pesgo1.PeUserInterface.Dialog.ExportTypeDef = ExportTypeDef.Png;
Pesgo1.PeUserInterface.Dialog.ExportDestDef = ExportDestDef.Clipboard;
Pesgo1.PeUserInterface.Dialog.ExportUnitXDef = "1280";
Pesgo1.PeUserInterface.Dialog.ExportUnitYDef = "768";
Pesgo1.PeUserInterface.Dialog.ExportImageDpi = 300;
Pesgo1.PeConfigure.RenderEngine = RenderEngine.Direct2D;
Pesgo1.PeConfigure.AntiAliasGraphics = true;
Pesgo1.PeConfigure.AntiAliasText = true;
// Call ReinitializeResetImage at end **'
Pesgo1.PeFunction.ReinitializeResetImage();
Pesgo1.Invalidate();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// Do not use this event to initialize ProEssentials controls, control creation is not 100% complete, use the Pego_Loaded event, as above. //
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
}
}
}