ProEssentials——著名的工业控制图表制作工具,能在网上搜到的各种源码资源很少,刚接触ProEssentials的人,可以先用下面的代码熟悉下。
//! 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 graph object. // // Graph‘s generally only contain YData because we assume // data is plotted equally spaced left to right. int s, p; // Enable Bar Glass Effect // Pego1.PePlot.Option.BarGlassEffect = true; // Enable Plotting style gradient and bevel features // Pego1.PePlot.Option.AreaGradientStyle = PlotGradientStyle.RadialBottomRight; Pego1.PePlot.Option.AreaBevelStyle = BevelStyle.MediumSmooth; Pego1.PePlot.Option.SplineGradientStyle = PlotGradientStyle.RadialBottomRight; Pego1.PePlot.Option.SplineBevelStyle = SplineBevelStyle.MediumSmooth; // v7.2 new features // Pego1.PePlot.Option.PointGradientStyle = PlotGradientStyle.VerticalAscentInverse; Pego1.PeColor.PointBorderColor = Color.FromArgb(100, 0, 0, 0); Pego1.PePlot.Option.LineSymbolThickness = 3; Pego1.PePlot.Option.AreaBorder = 1; Pego1.PeUserInterface.Dialog.AllowSvgExport = true; // Prepare images in memory // Pego1.PeConfigure.PrepareImages = true; // Pass Data // Pego1.PeData.Subsets = 4; Pego1.PeData.Points = 12; for(s = 0; s <= 3; s++) { for(p = 0; p < 12; p++) { Pego1.PeData.Y[s, p] = ((p + 1) * 50) + ((float)(Rand_Num.NextDouble()) * 250) + 2 + 700.0F - ((s * 140.0F)); } } Pego1.PePlot.DataShadows = DataShadows.Shadows; Pego1.PeUserInterface.Allow.FocalRect = false; Pego1.PePlot.Method = GraphPlottingMethod.Area; Pego1.PeGrid.LineControl = GridLineControl.Both; Pego1.PeGrid.Style = GridStyle.Dot; Pego1.PePlot.Allow.Ribbon = true; Pego1.PeUserInterface.Allow.Zooming = AllowZooming.HorzAndVert; Pego1.PeUserInterface.Allow.ZoomStyle = ZoomStyle.Ro2Not; // Enable middle mouse dragging // Pego1.PeUserInterface.Scrollbar.MouseDraggingX = true; Pego1.PeUserInterface.Scrollbar.MouseDraggingY = true; Pego1.PeString.MainTitle = "Units Sold per Month"; Pego1.PeString.SubTitle = ""; Pego1.PeString.YAxisLabel = "Units Sold"; Pego1.PeString.XAxisLabel = "Month"; // subset labels // Pego1.PeString.SubsetLabels[0] = "Texas"; Pego1.PeString.SubsetLabels[1] = "Florida"; Pego1.PeString.SubsetLabels[2] = "Washington"; Pego1.PeString.SubsetLabels[3] = "California"; // point labels // Pego1.PeString.PointLabels[0] = "January"; Pego1.PeString.PointLabels[1] = "February"; Pego1.PeString.PointLabels[2] = "March"; Pego1.PeString.PointLabels[3] = "April"; Pego1.PeString.PointLabels[4] = "May"; Pego1.PeString.PointLabels[5] = "June"; Pego1.PeString.PointLabels[6] = "July"; Pego1.PeString.PointLabels[7] = "August"; Pego1.PeString.PointLabels[8] = "September"; Pego1.PeString.PointLabels[9] = "October"; Pego1.PeString.PointLabels[10] = "November"; Pego1.PeString.PointLabels[11] = "December"; // subset colors // Pego1.PeColor.SubsetColors[0] = Color.FromArgb(128, 198, 0, 0); Pego1.PeColor.SubsetColors[1] = Color.FromArgb(128, 0, 198, 198); Pego1.PeColor.SubsetColors[2] = Color.FromArgb(128, 198, 198, 0); Pego1.PeColor.SubsetColors[3] = Color.FromArgb(128, 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; Pego1.PeData.Precision = DataPrecision.OneDecimal; Pego1.PeTable.Show = GraphPlusTable.Both; Pego1.PePlot.MarkDataPoints = false; Pego1.PeConfigure.ImageAdjustLeft = 20; Pego1.PeConfigure.ImageAdjustRight = 20; Pego1.PeConfigure.ImageAdjustTop = 10; // Set various export defaults // Pego1.PeSpecial.DpiX = 600; Pego1.PeSpecial.DpiY = 600; // default export setting // Pego1.PeUserInterface.Dialog.ExportSizeDef = ExportSizeDef.NoSizeOrPixel; Pego1.PeUserInterface.Dialog.ExportTypeDef = ExportTypeDef.Png; Pego1.PeUserInterface.Dialog.ExportDestDef = ExportDestDef.Clipboard; Pego1.PeUserInterface.Dialog.ExportUnitXDef = "1280"; Pego1.PeUserInterface.Dialog.ExportUnitYDef = "768"; Pego1.PeUserInterface.Dialog.ExportImageDpi = 300; Pego1.PeUserInterface.Dialog.AllowSvgExport = true; Pego1.PeConfigure.RenderEngine = RenderEngine.Direct2D; Pego1.PeConfigure.AntiAliasGraphics = true; Pego1.PeConfigure.AntiAliasText = true; // Generally call ReinitializeResetImage at end **‘ Pego1.PeFunction.ReinitializeResetImage(); // Optionally call Pego1.Refresh() if you are not seeing changes immediately
动画效果请访问:http://www.evget。com/article/2014/1/15/20408.html