📄 frmgraph.cs
字号:
Pego1.PeString.PointLabels[10] = "十一月";
Pego1.PeString.PointLabels[11] = "十二月";
// subset colors //
Pego1.PeColor.SubsetColors[0] = Color.FromArgb(198, 0, 0);
Pego1.PeColor.SubsetColors[1] = Color.FromArgb(0, 198, 198);
Pego1.PeColor.SubsetColors[2] = Color.FromArgb(198, 198, 0);
Pego1.PeColor.SubsetColors[3] = Color.FromArgb(0, 198, 0);
// subset line types //
Pego1.PeLegend.SubsetLineTypes[0] = LineType.MediumSolid;
Pego1.PeLegend.SubsetLineTypes[1] = LineType.MediumSolid;
Pego1.PeLegend.SubsetLineTypes[2] = LineType.MediumSolid;
Pego1.PeLegend.SubsetLineTypes[3] = LineType.MediumSolid;
Pego1.PeLegend.SubsetLineTypes[4] = LineType.MediumSolid;
Pego1.PeLegend.SubsetLineTypes[5] = LineType.MediumSolid;
Pego1.PeLegend.SubsetLineTypes[6] = LineType.MediumSolid;
Pego1.PeLegend.SubsetLineTypes[7] = LineType.MediumSolid;
// subset point types //
Pego1.PeLegend.SubsetPointTypes[0] = PointType.DotSolid;
Pego1.PeLegend.SubsetPointTypes[1] = PointType.UpTriangleSolid;
Pego1.PeLegend.SubsetPointTypes[2] = PointType.SquareSolid;
Pego1.PeLegend.SubsetPointTypes[3] = PointType.DownTriangleSolid;
Pego1.PeLegend.SubsetPointTypes[4] = PointType.Dot;
Pego1.PeLegend.SubsetPointTypes[5] = PointType.UpTriangle;
Pego1.PeLegend.SubsetPointTypes[6] = PointType.Square;
Pego1.PeLegend.SubsetPointTypes[7] = PointType.DownTriangle;
Pego1.PeLegend.SimplePoint = true;
Pego1.PeLegend.SimpleLine = true;
Pego1.PeLegend.Style = LegendStyle.OneLine;
// Allow stacked type graphs //
Pego1.PePlot.Allow.StackedData = true;
// Various other features //
Pego1.PeFont.Fixed = true;
Pego1.PeColor.BitmapGradientMode = true;
Pego1.PeColor.QuickStyle = QuickStyle.MediumLine;
Pego1.PePlot.Option.GradientBars = 8;
Pego1.PePlot.Option.LineShadows = true;
Pego1.PeFont.MainTitle.Bold = true;
Pego1.PeFont.SubTitle.Bold = true;
Pego1.PeFont.Label.Bold = true;
Pego1.PeConfigure.TextShadows = TextShadows.BoldText;
Pego1.PeFont.FontSize = FontSize.Large;
// Generally call ReinitializeResetImage at end **'
Pego1.PeFunction.ReinitializeResetImage();
}
else if(m_nChart == 1)
{
//*********************************************************************'
//*********************************************************************'
//001 Graph With Auto Statistical Subsets
//! Right button click to show popup menu. //
//! Double Click to show customization dialog. //
// This example builds upon the basic CreateSimpleGraph '000' example chart //
CreateSimpleGraph();
// Below tells object to automatically generate statistical
// comparison subsets, object will actually have
// 6 subsets when finished initializing.
Pego1.PePlot.AutoStatSubsets[0] = (int) Gigasoft.ProEssentials.Enums.AutoStatSubsets.AverageAllPoints;
Pego1.PePlot.AutoStatSubsets[1] = (int) Gigasoft.ProEssentials.Enums.AutoStatSubsets.AveragePerPoint;
// Other various properties //
Pego1.PeColor.BitmapGradientMode = true;
Pego1.PeColor.QuickStyle = QuickStyle.DarkLine;
Pego1.PeLegend.Style = LegendStyle.OneLineInsideAxis;
Pego1.PePlot.Method = GraphPlottingMethod.Bar;
Pego1.PePlot.MarkDataPoints = true;
}
else if(m_nChart == 2)
{
//*********************************************************************'
//*********************************************************************'
//002 Graph With Permanent and Scrolling Subsets
//! Scroll vertical scroll bar to revolve subsets. //
//! Right button click to show popup menu. //
//! Double Click to show customization dialog. //
// This example builds upon the basic CreateSimpleGraph '000' example chart //
CreateSimpleGraph();
// tells object to automatically generate statistical
// comparison subsets, the object will have
// 6 subsets when finished reinitializing.
Pego1.PePlot.AutoStatSubsets[0] = (int) Gigasoft.ProEssentials.Enums.AutoStatSubsets.AverageAllPoints; // This will be 5th subset
Pego1.PePlot.AutoStatSubsets[1] = (int) Gigasoft.ProEssentials.Enums.AutoStatSubsets.AveragePerPoint; // This will be 6th subset
// Since we are scrolling subsets one at a time,
// we can set the AverageAllPoints and AveragePerPoint subsets as
// permanent. This allows individual subsets to be
// compared to the averages of all points.
Pego1.PeData.RandomSubsetsToGraph[0] = 4; // zero based 5th subset, PEAS_AVGAP
Pego1.PeData.RandomSubsetsToGraph[1] = 5; // zero based 6th subset, PEAS_AVGPP
// If we comment this line out, you will only see the
// 5th and 6th subset selected above. RandomSubsetsToGraph
// will either control which subset you see or which
// subsets are permanent if ScrollingSubsets is non-zero.
Pego1.PeUserInterface.Scrollbar.ScrollingSubsets = 1; // Scroll one subset at a time
Pego1.PeTable.What = TableWhat.AllSubsets;
// Add a table //
Pego1.PeTable.Show = GraphPlusTable.Both;
Pego1.PeData.Precision = 0;
Pego1.PeFont.FontSize = FontSize.Large;
// Other various properties //
Pego1.PeColor.BitmapGradientMode = true;
Pego1.PeColor.QuickStyle = QuickStyle.MediumNoBorder;
Pego1.PeLegend.Style = LegendStyle.OneLineInsideAxis;
Pego1.PePlot.Method = GraphPlottingMethod.Bar;
Pego1.PePlot.Option.BestFitDegree = BestFitDegree.Fourth;
Pego1.PePlot.MarkDataPoints = true;
Pego1.PeLegend.Style = LegendStyle.OneLine;
}
else if(m_nChart == 3)
{
//*********************************************************************'
//*********************************************************************'
//003 Graph With Right Y Axis Comparison Subsets
// This example builds upon the basic CreateSimpleGraph '000' example chart //
CreateSimpleGraph();
// Set plotting method to Bar //
Pego1.PePlot.Method = GraphPlottingMethod.Bar;
// Designate last 2 subsets as right y axis comparison subsets
Pego1.PePlot.RYAxisComparisonSubsets = 2;
// Set Comparison PlottingMethod
Pego1.PePlot.MethodII = GraphPlottingMethodII.PointsPlusLine;
// Label Right Y Axis //
Pego1.PeString.RYAxisLabel = "Expected";
// Other various properties //
Pego1.PeColor.BitmapGradientMode = true;
Pego1.PeColor.QuickStyle = QuickStyle.DarkNoBorder;
Pego1.PeColor.SubsetColors[0] = Color.FromArgb(100, 0, 0);
Pego1.PeColor.SubsetColors[1] = Color.FromArgb(0, 100, 100);
Pego1.PeColor.SubsetColors[2] = Color.FromArgb(198, 198, 0);
Pego1.PeColor.SubsetColors[3] = Color.FromArgb(0, 198, 0);
}
else if(m_nChart == 4)
{
//*********************************************************************'
//*********************************************************************'
//004 Graph showing simple high-low-close
// This example builds upon the basic CreateSimpleGraph '000' example chart //
CreateSimpleGraph();
// Set PlottingMethod and SpecificPlotMode Type //
Pego1.PePlot.Method = GraphPlottingMethod.SpecificPlotMode;
Pego1.PePlot.SpecificPlotMode = SpecificPlotMode.HighLowClose;
// setting this true causes high-low-close to be multi colored
Pego1.PePlot.Option.SpecificPlotModeColor = true;
// Change Data to something more appropriate //
Pego1.PeData.Subsets = 3; // set number of subsets
Pego1.PeData.Points = 12; // number of data points
// Pass YData, Line Start, Line End, and Close Value //
Int32 s, p;
for(s = 0; s <= 2; s++)
{
for(p = 0; p <= 11; p++)
{
if(s == 0)
Pego1.PeData.Y[s, p] = ((p + 1) * 10 + ((float)(Rand_Num.NextDouble()) * 25));
else if(s == 1)
Pego1.PeData.Y[s, p] = ((p + 1) * 40 + ((float)(Rand_Num.NextDouble()) * 25));
else if( s == 2)
Pego1.PeData.Y[s, p] = ((p + 1) * 20 + ((float)(Rand_Num.NextDouble()) * 25));
}
}
}
else if(m_nChart == 5)
{
//*********************************************************************'
//*********************************************************************'
//005 Graph With Custom Y Axis
// This example builds upon the basic CreateSimpleGraph '000' example chart //
CreateSimpleGraph();
// Disable default scale //
Pego1.PeGrid.Option.ShowYAxis = ShowAxis.Empty;
// Generally, a custom y axis will need manual range control //
Pego1.PeGrid.Configure.ManualScaleControlY = ManualScaleControl.MinMax;
Pego1.PeGrid.Configure.ManualMinY = 0.0;
Pego1.PeGrid.Configure.ManualMaxY = 1000.0;
// Create custom grid lines with HorzLineAnnotations //
// Note that GridLineControl will control these annotations //
Pego1.PeAnnotation.Line.YAxis[0] = 200;
Pego1.PeAnnotation.Line.YAxisType[0] = LineAnnotationType.GridLine;
Pego1.PeAnnotation.Line.YAxisText[0] = "|LLow Value";
Pego1.PeAnnotation.Line.YAxis[1] = 500;
Pego1.PeAnnotation.Line.YAxisType[1] = LineAnnotationType.GridLine;
Pego1.PeAnnotation.Line.YAxisText[1] = "|LMedium Value";
Pego1.PeAnnotation.Line.YAxis[2] = 800;
Pego1.PeAnnotation.Line.YAxisType[2] = LineAnnotationType.GridLine;
Pego1.PeAnnotation.Line.YAxisText[2] = "|LHigh Value";
Pego1.PeAnnotation.Line.YAxis[3] = 350;
Pego1.PeAnnotation.Line.YAxisType[3] = LineAnnotationType.GridTick;
Pego1.PeAnnotation.Line.YAxisText[3] = "";
Pego1.PeAnnotation.Line.YAxis[4] = 650;
Pego1.PeAnnotation.Line.YAxisType[4] = LineAnnotationType.GridTick;
Pego1.PeAnnotation.Line.YAxisText[4] = "";
// Set LeftMargin to allocate space for line annotation text //
// Use the longest string used in annotations.
Pego1.PeAnnotation.Line.LeftMargin = "Medium Value ";
// Set this to see annotations //
Pego1.PeAnnotation.Show = true;
// Increase line annotation text size //
Pego1.PeFont.LineAnnotationTextSize = 100;
// Put Grid In Front of Bars //
Pego1.PeGrid.InFront = true;
// Other various properties //
Pego1.PeColor.BitmapGradientMode = true;
Pego1.PeColor.QuickStyle = QuickStyle.LightInset;
}
else if(m_nChart == 6)
{
//*********************************************************************'
//*********************************************************************'
//006 Graph showing use of Null Data Gaps
// This example builds upon the basic CreateSimpleGraph '000' example chart //
CreateSimpleGraph();
// Change Null Data Value //
// Note that Scientific Graph has NullDataValueX and NullDataValueY //
Pego1.PeData.NullDataValue = -9999.0;
// Change to two subsets and set a few data points to nulls //
Pego1.PeData.Subsets = 2;
Pego1.PeData.Y[0, 3] = -9999;
Pego1.PeData.Y[0, 4] = -9999;
Pego1.PeData.Y[0, 5] = -9999;
Pego1.PeData.Y[1, 5] = -9999; //! Note that (1,6) and (1,8) are valid points
Pego1.PeData.Y[1, 7] = -9999; //! You will see symbols for these points because
Pego1.PeData.Y[1, 9] = -9999; //! they are surrounded by nulls.
// Set line Plotting Method //
Pego1.PePlot.Method = GraphPlottingMethod.Line;
// Enable Null Data Gaps //
// Using NullDataGaps, the subset's line will stop before null data values //
// If this line is commented out, then line will extend to next non-null //
Pego1.PePlot.Option.NullDataGaps = true;
// Other various properties //
Pego1.PeColor.BitmapGradientMode = true;
Pego1.PeColor.QuickStyle = QuickStyle.MediumInset;
Pego1.PePlot.MarkDataPoints = true;
}
else if(m_nChart == 7)
{
//*********************************************************************'
//*********************************************************************'
//007 Graph showing use of PEconvpixeltograph
//! Look at TitleBar for the chart's window. As you
//! move the mouse, you will see the coordinates of the
//! mouse in the titlebar.
//! Right button click to show popup menu. //
//! Double Click to show customization dialog. //
// This example builds upon the basic CreateSimpleGraph '000' example chart //
CreateSimpleGraph();
// Other various properties //
Pego1.PeColor.BitmapGradientMode = true;
Pego1.PeColor.QuickStyle = QuickStyle.LightShadow;
Pego1.PePlot.MarkDataPoints = true;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -