您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 质量控制/管理 > ZedGraph教程
ZedGraph是一个非常优秀的开源的作图控件1、在vs中使用ZedGraph2、基本一些概念几个注意点:图片的保存路径设置:RenderedImagePath属性中设置,程序对该文件夹应该是有写和修改权限的图片的输出格式:OutputFormat属性中设置,Png的推荐,比较清晰。ChartChartBorder图表区域的边框设置ChartFill图表区域的背景填充Legend图表的注释标签显示设置项目,一组数据对应一种颜色的注释IsHStack当有多个显示项的时候设置Y轴数据是叠加的还是分开的Xaxis图表区域的X轴相关信息设置AxisColor坐标轴颜色Cross坐标的原点,可以设置坐标的偏移程度CrossAuto原点自动设置:True的话Cross的设置就无效了。FontSpecX轴标题字体相关信息AngleX轴标题字体显示时候的角度,0为水平90为垂直FillX轴标题字体填充信息ColorOpacity透明度IsScaled设置X轴标题字体显示大小是否根据图的比例放大缩小RangeMax填充时候的最大倾斜度(有过渡色,没试过)RangeMin填充时候的最小倾斜度(有过渡色,没试过)StringAlignmentX轴标题字体排列(不清楚,没试过)IsOmitMag是否显示指数幂(10次方,没试过,似乎与IsUseTenPower有关系)IsPreventLabelOverlap坐标值显示是否允许重叠,如果False的话,控件会根据坐标值长度自动消除部分坐标值的显示状态IsShowTitleX轴标题是否显示IsTicsBetweenLabels两个坐标值之间是否自动显示分隔标志IsUseTenPower是否使用10次幂指数IsZeroLine当数据为0时候是否显示(在饼状图显示的时候有用)IsVisible是否显示X轴MajorGrid大跨度的X轴表格虚线线显示信息DashOff虚线中孔间距DashOn虚线单位长度MajorTic大跨度的X轴刻度信息IsInside在Chart内部是否显示IsOutSide在Chart外部是否显示IsOpposite在对面的轴上是否显示MinorGrid小跨度的X轴表格虚线显示信息MinorTic小跨度的x轴刻度信息MinSpace刻度和轴之间的距离(没试过)Scale刻度值的一些设定IsReverseX轴的刻度值从高到低还是从低到高MajorStep大刻度步长MajorStepAuto是否自动设置大刻度步长MajorUnit大刻度步长单位Max刻度最大值MaxAuto根据输入数据自动设置刻度最大值Min刻度最小值MinAuto根据输入数据自动设置刻度最小值MinGrace不清楚,没试过MinorStep小刻度步长MinorStepAuto是否自动设置小刻度步长MinorUnit小刻度单位Type数据显示方式Liner直接现实(自动)Date按日期方式显示Log按指数幂方式显示Ordinal顺序显示Y2Axis第二个Y轴坐标信息显示(具体设置看X轴)Yaxis第一个Y轴坐标信息显示(具体设置看X轴)BarBase在生成柱状图的时候设置柱状是基于X轴还是其他轴BarType柱状的类型叠加或其他。IsFontsScaled图比例变化时候图表上的文字是否跟着自动缩放IsIgnoreInitial是否忽略初始值IsIgnoreMissing是否忽略缺省值IsPenWidthScaled图比例变化时候图表上的画笔的粗细是否跟着自动缩放IsShowTitle图表标题是否显示PaneFillPane的一些填充信息BaseDimension缩放比例基数(可以试试效果)IsImageMap不清楚干吗用的AxisChaneged是否允许自动绘图(没试过,一般都true,动态绘图)CacheDurationCache保存时间0OutputFormat输出格式RenderedImagePath输出路径RenderMode输出模式,不太清楚一般都是ImageTag,另一个输出的是乱码不是图片。对于图表而言,一般是三种表现形式:柱状图、饼状图和点线图。ClassDescriptionMasterPaneAclasstomanagemultipleGraphPaneobjects,derivedfromPaneBase.UseoftheMasterPaneclassisoptional,astheGraphPaneclasscanbeuseddirectlyforasinglepane.Alsoprovidesmethodsforlayout,arrangement,andmanagementoftheindividualGraphPaneobjects.GraphPaneTheprimaryclassforthegraph,derivedfromPaneBase.Includesallotherclassesasproperties.Alsocontrolsthepanetitle,thepaneframeandaxisframe,backgrounds,etc.XAxis,YAxis,Y2AxisChildrenoftheAxisclass.Theseclassesincludemanyaspectsoftheaxisdisplay,includingtics,grids,colors,pens,fonts,labels,andstyles.ScaleAclassinstancemaintainedbytheAxisclass.Containsthescalerange,stepsizes,formats,anddisplayoptionsforthescale.ComesinvariantsforLinear,Log,Text,Date,Ordinal,Exponent,LinearAsOrdinal,andDateAsOrdinalscales.LegendTheclassthatdescribesthelocation,font,colors,etc.,usedtodrawthelegend.CurveItemAnabstractbaseclassthatcontainsdataforasinglecurve.LineItem,BarItem,HiLowBarItem,ErrorBarItem,PieItem,StickItem,OHLCBarItem,andJapaneseCandleStickItemareallderivedfromthisclass.CurveListAcollectionclasstomaintainalistofCurveItemobjects.TheorderofthecurvesinthelistcontrolstheZ-Orderfordrawing.Thelastcurveinthelistwillappearbehindallothercurves.GraphObjAnabstractbaseclassthatincludespositioninformationforavarietyofsupplementalgraphicobjectsonaplot.TextObj,ImageObj,LineObj,ArrowObj,EllipseObj,BoxObj,andPolyObjarederivedfromGraphObj.GraphObjListAcollectionclasstomaintainalistofGraphObjobjects.Theorderoftheobjectsinthelist,plusaZOrderproperty,controltheZ-Orderfordrawing.ThelastiteminthelistwillappearbehindallotheritemswiththesameZOrdervalue.FontSpecAutilityclassthatincludesinformationaboutthefontfamily,color,angle,size,style,frame,andbackgroundfillofthetextonthegraph.EachclassthatincludestextinformationwillcontainoneormoreFontSpecobjectstospecificallydescribetheassociatedfonts.FillAutilityclassthatincludescharacteristicsofbackgroundcolorfills.EachobjectthathascolorfillcapabilitywillcontainoneormoreFillobjectstospecificallydescribetheassociatedcolorfill.BorderAutilityclassthatincludescharacteristicsofobjectborders.EachobjectthathasbordercapabilitywillcontainoneormoreBorderobjectstospecificallydescribetheassociatedbordercolorandlineproperties.LocationAgeneralclassforhandlingthelocationofgraphicobjectsontheplot.PointPairAdatastructthatencapsulatesasinglepairofdoublevaluesrepresentingan(X,Y)datapoint.ThisistheinternaldatastorageformatforthevaluearraysineachCurveItem.PointPairListAcollectionclasstomaintainalistofPointPairobjects.XDateThisclassencapsulatesasingledate-timevalue(storedasaSystem.Double),plusawidearrayofmethodstoconvertbetweenXLdate,AstronomicalJulianDaynumber,GregorianCalendardate,fractionalyear,etc.SeethediscussionofDate-Timeaxesbelow,fordetails.Member-DescriptionAxisChange()()-ThisperformsanaxischangecommandonthegraphPane.BeenDisposed-Thischecksifthecontrolhasbeendisposed.Thisissynonymouswiththegraphpanehavingbeennulledordisposed.ThereforethisisthesameasZedGraphControl.GraphPane==null.BorderStyle-Getsorsetstheborderstyleofthetreeviewcontrol.(InheritedfromUserControl.)ContextMenuBuilder-SubscribetothiseventtobeabletomodifytheZedGraphcontextmenu.Copy(Boolean)-将图像复制到剪贴板。DoPageSetup()()-打开打印设置对话框。DoPrint()()-打印图表。DoPrintPreview()()-打印预览。EditButtons-Getsorsetsavaluethatdeter
本文标题:ZedGraph教程
链接地址:https://www.777doc.com/doc-4160288 .html