ProEssentials图表控件如何用于.NET上创建图表

作者:控件中国网   出处:控件中国网   2015-06-10 16:24:45   阅读:7

ProEssentials是一款支持多开发平台的现代化专业图表控件,包含了几十种常用的图表类型,灵活的API使开发人员可以创建独具特色的数据展示应用程序,下面主要介绍如何在Visual Studio上使用ProEssentials快速创建图表。

当下载安装该产品后,控件会集成到Visual Studio的工具箱里,如果没有自动集成,您也可以手动添加。ProEssentials支持设计时设计,也就是说您完全可以可视化地完成图表的创建,当然在实际的应用中,还是以代码创建图表最为常见。

首先从您的工具箱里把对应的想创建的图表类型(Pe3do, Pego, Pepco, Pepso, and Pesgo)拖拽到您程序的窗体上.本例则需要把Pego拖拽到窗体上,然后在Form1_Load事件里添加如下代码:

pego1.PeString.MainTitle = "Hello World";
pego1.PeString.SubTitle = "";

pego1.PeData.Subsets = 2;
pego1.PeData.Points = 6;
pego1.PeData.Y[0, 0] = 10; pego1.PeData.Y[0, 1] = 30;
pego1.PeData.Y[0, 2] = 20; pego1.PeData.Y[0, 3] = 40;
pego1.PeData.Y[0, 4] = 30; pego1.PeData.Y[0, 5] = 50;
pego1.PeData.Y[1, 0] = 15; pego1.PeData.Y[1, 1] = 63;
pego1.PeData.Y[1, 2] = 74; pego1.PeData.Y[1, 3] = 54;
pego1.PeData.Y[1, 4] = 25; pego1.PeData.Y[1, 5] = 34;

pego1.PeString.PointLabels[0] = "Jan";
pego1.PeString.PointLabels[1] = "Feb";
pego1.PeString.PointLabels[2] = "Mar";
pego1.PeString.PointLabels[3] = "Apr";
pego1.PeString.PointLabels[4] = "May";
pego1.PeString.PointLabels[5] = "June";

pego1.PeString.SubsetLabels[0] = "For .Net Framework";
pego1.PeString.SubsetLabels[1] = "or MFC, ActiveX, VCL";
pego1.PeString.YAxisLabel = "Simple Quality Rendering";

pego1.PeColor.SubsetColors[0] = System.Drawing.Color.FromArgb(60, 0, 180, 0);
pego1.PeColor.SubsetColors[1] = System.Drawing.Color.FromArgb(180, 0, 0, 130);
pego1.PeColor.BitmapGradientMode = false;
pego1.PeColor.QuickStyle = Gigasoft.ProEssentials.Enums.QuickStyle.LightShadow;
pego1.PeTable.Show = Gigasoft.ProEssentials.Enums.GraphPlusTable.Both;
pego1.PeData.Precision = Gigasoft.ProEssentials.Enums.DataPrecision.NoDecimals;
pego1.PeFont.Label.Bold = true;
pego1.PePlot.Method = Gigasoft.ProEssentials.Enums.GraphPlottingMethod.Bar;
pego1.PePlot.Option.GradientBars = 8;
pego1.PePlot.Option.BarGlassEffect = true;
pego1.PeLegend.Location = Gigasoft.ProEssentials.Enums.LegendLocation.Left;
pego1.PePlot.DataShadows = Gigasoft.ProEssentials.Enums.DataShadows.ThreeDimensional;
pego1.PeFont.FontSize = Gigasoft.ProEssentials.Enums.FontSize.Large; pego1.PeConfigure.RenderEngine =

Gigasoft.ProEssentials.Enums.RenderEngine.Direct2D;
pego1.PeConfigure.AntiAliasGraphics = true;
pego1.PeConfigure.AntiAliasText = true;
pego1.PeUserInterface.HotSpot.Data = true;
pego1.PeFunction.ReinitializeResetImage();
pego1.Refresh(); // call standard .NET Refresh method to force paint

运行该程序的具体效果如下:
netchartwinformexe.png

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat