ZedGraph教程.doc_第1页
ZedGraph教程.doc_第2页
ZedGraph教程.doc_第3页
ZedGraph教程.doc_第4页
ZedGraph教程.doc_第5页
已阅读5页,还剩35页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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,另一个输出的是乱码不是图片。对于图表而言,一般是三种表现形式:柱状图、饼状图和点线图。ClassDescriptionMasterPaneA class to manage multiple GraphPane objects, derived from PaneBase. Use of the MasterPane class is optional, as the GraphPane class can be used directly for a single pane. Also provides methods for layout, arrangement, and management of the individual GraphPane objects.GraphPaneThe primary class for the graph, derived from PaneBase. Includes all other classes as properties. Also controls the pane title, the pane frame and axis frame, backgrounds, etc.XAxis, YAxis, Y2AxisChildren of the Axis class. These classes include many aspects of the axis display, including tics, grids, colors, pens, fonts, labels, and styles.ScaleA class instance maintained by the Axis class. Contains the scale range, step sizes, formats, and display options for the scale. Comes in variants for Linear, Log, Text, Date, Ordinal, Exponent, LinearAsOrdinal, and DateAsOrdinal scales.LegendThe class that describes the location, font, colors, etc., used to draw the legend.CurveItemAn abstract base class that contains data for a single curve. LineItem, BarItem, HiLowBarItem, ErrorBarItem, PieItem, StickItem, OHLCBarItem, and JapaneseCandleStickItem are all derived from this class.CurveListA collection class to maintain a list of CurveItem objects. The order of the curves in the list controls the Z-Order for drawing. The last curve in the list will appear behind all other curves.GraphObjAn abstract base class that includes position information for a variety of supplemental graphic objects on a plot. TextObj, ImageObj, LineObj, ArrowObj, EllipseObj, BoxObj, and PolyObj are derived from GraphObj.GraphObjListA collection class to maintain a list of GraphObj objects. The order of the objects in the list, plus a ZOrder property, control the Z-Order for drawing. The last item in the list will appear behind all other items with the same ZOrder value.FontSpecA utility class that includes information about the font family, color, angle, size, style, frame, and background fill of the text on the graph. Each class that includes text information will contain one or more FontSpec objects to specifically describe the associated fonts.FillA utility class that includes characteristics of background color fills. Each object that has color fill capability will contain one or more Fill objects to specifically describe the associated color fill.BorderA utility class that includes characteristics of object borders. Each object that has border capability will contain one or more Border objects to specifically describe the associated border color and line properties.LocationA general class for handling the location of graphic objects on the plot.PointPairA data struct that encapsulates a single pair of double values representing an (X,Y) data point. This is the internal data storage format for the value arrays in each CurveItem.PointPairListA collection class to maintain a list of PointPair objects.XDateThis class encapsulates a single date-time value (stored as a System.Double), plus a wide array of methods to convert between XL date, Astronomical Julian Day number, Gregorian Calendar date, fractional year, etc. See the discussion of Date-Time axes below, for details.Member - DescriptionAxisChange()() - This performs an axis change command on the graphPane.BeenDisposed - This checks if the control has been disposed. This is synonymous with the graph pane having been nulled or disposed. Therefore this is the same as ZedGraphControl.GraphPane = null.BorderStyle - Gets or sets the border style of the tree view control. (Inherited from UserControl.)ContextMenuBuilder - Subscribe to this event to be able to modify the ZedGraph context menu.Copy(Boolean) - 将图像复制到剪贴板。DoPageSetup()() - 打开打印设置对话框。DoPrint()() - 打印图表。DoPrintPreview()() - 打印预览。EditButtons - Gets or sets a value that determines which Mouse button will be used to edit point data valuesEditModifierKeys - Gets or sets a value that determines which modifier keys will be used to edit point data valuesGetImage()() - 返回图表上的图像。GraphPane - Gets or sets the GraphPane property for the controlIsAntiAlias - Gets or sets a value that determines if all drawing operations for this control will be forced to operate in Anti-alias mode. Note that if this value is set to true, it overrides the setting for sub-objects. Otherwise, the sub-object settings (such as IsAntiAlias) will be honored.IsAutoScrollRange - Gets or sets a value that controls whether or not the axis value range for the scroll bars will be set automatically.IsEnableHEdit - Gets or sets a value that determines whether or not editing of point data is allowed in the horizontal direction.IsEnableHPan - Gets or sets a value that determines whether or not panning is allowed for the control in the horizontal direction.IsEnableHZoom - 是否允许横向缩放。IsEnableSelection - Gets or sets a value that determines whether or not selection is allowed for the control.IsEnableVEdit - Gets or sets a value that determines whether or not editing of point data is allowed in the vertical direction.IsEnableVPan - Gets or sets a value that determines whether or not panning is allowed for the control in the vertical direction.IsEnableVZoom - 是否允许纵向缩放。IsEnableZoom - 是否允许缩放。IsPrintFillPage - Gets or sets a value that determines whether or not the MasterPaneRectdimensions will be expanded to fill the available space when printing this ZedGraphControl.IsPrintKeepAspectRatio - Gets or sets a value that determines whether or not the visible aspect ratio of the MasterPaneRectwill be preserved when printing this ZedGraphControl.IsPrintScaleAll - Gets or sets a value that determines whether the settings of IsFontsScaled and IsPenWidthScaled will be overridden to true during printing operations.IsScrolling - Returns true if the user is currently scrolling via the scrollbar, or false if no scrolling is taking place.IsScrollY2 - Gets or sets a value that determines if the vertical scroll bar will affect the Y2 axis.IsShowContextMenu - 是否显示右键菜单,如果指定了ContextMenuStrip会一直显示指定的ContextMenu。IsShowCopyMessage - 复制图像时是否显示提示信息。IsShowCursorValues - 鼠标在图表上移动时是否显示鼠标所在点对应的坐标值。默认为falseIsShowHScrollBar - 是否显示横向滚动条。IsShowPointValues - 鼠标经过图表上的点时是否气泡显示该点所对应的值。默认为falseIsShowVScrollBar - 是否显示纵向滚动条。IsSynchronizeXAxes - Gets or sets a value that determines if the XAxisScaleranges for all GraphPane objects in the MasterPane will be forced to match.IsSynchronizeYAxes - Gets or sets a value that determines if the YAxisScaleranges for all GraphPane objects in the MasterPane will be forced to match.IsZoomOnMouseCenter - 使用滚轮时以鼠标所在点进行缩放还是以图形中心进行缩放。LinkButtons - Gets or sets a value that determines which Mouse button will be used to click on linkable objectsLinkEvent - Subscribe to this event to be able to respond to mouse clicks within linked objects.LinkModifierKeys - Gets or sets a value that determines which modifier keys will be used to click on linkable objectsMasterPane - Gets or sets the MasterPane property for the controlMouseDownEvent - 代替MouseDown事件,有一个bool类型的返回值,代表是否响应该事件。MouseUpEvent - 代替MouseUp事件,有一个bool类型的返回值,代表是否响应该事件。PanButtons - Gets or sets a value that determines which mouse button will be used as a primary option to trigger a pan event.PanButtons2 - Gets or sets a value that determines which mouse button will be used as the secondary option to trigger a pan event.PanModifierKeys - Gets or sets a value that determines which modifier keys will be used as a primary option to trigger a pan event.PanModifierKeys2 - Gets or sets a value that determines which modifier keys will be used as a secondary option to trigger a pan event.PointDateFormat - Gets or sets the format for displaying tooltip values. This format is passed to ToString(String).PointEditEvent - Subscribe to this event to receive notifcation and/or respond after a data point has been edited via IsEnableHEdit and IsEnableVEdit.PointValueEvent - Subscribe to this event to provide custom formatting for the tooltipsPointValueFormat - Gets or sets the format for displaying tooltip values. This format is passed to ToString(String).PrintDocument - Gets or sets the PrintDocumentinstance that is used for all of the context menu printing functions.RestoreScale(GraphPane) - Handler for the Set Scale to Default context menu item. Sets the scale ranging to full auto mode for all axes.SaveAs()() - 显示另存为对话框。SaveAsBitmap()() - 显示另存为对话框,将图像另存为BMP文件。SaveAsEmf()() - 显示另存为对话框,将图像另存为EMF文件。SaveFileDialog - Gets or sets the SaveFileDialog instance that will be used by the Save As. context menu item.ScrollDoneEvent - Subscribe to this event to be notified when the GraphPane is scrolled by the user using the scrollbars.ScrollEvent - Subscribe to this event to be notified when the GraphPane is scrolled by the user using the scrollbars.ScrollGrace - Set a grace value that leaves a buffer area around the data when IsAutoScrollRange is true.ScrollMaxX - The maximum value for the X axis scroll range.ScrollMaxY - The maximum value for the Y axis scroll range.ScrollMaxY2 - The maximum value for the Y2 axis scroll range.ScrollMinX - The minimum value for the X axis scroll range.ScrollMinY - The minimum value for the Y axis scroll range.ScrollMinY2 - The minimum value for the Y2 axis scroll range.ScrollProgressEvent - Subscribe to this event to be notified when the GraphPane is scrolled by the user using the scrollbars.SelectAppendModifierKeys - Gets or sets a value that determines which Modifier keys will be used to append a CurveItem to the selection list.SelectButtons - Gets or sets a value that determines which Mouse button will be used to select CurveItems.Selection - Readonly property that gets the list of selected CurveItemsSelectModifierKeys - Gets or sets a value that determines which Modifier keys will be used to select CurveItems.SetScrollRangeFromData()() - Sets the value of the scroll range properties (see ScrollMinX, ScrollMaxX, YScrollRangeList, and Y2ScrollRangeList based on the actual range of the data for each corresponding Axis.Y2ScrollRangeList - Access the ScrollRangeList for the Y2 axes.YScrollRangeList - Access the ScrollRangeList for the Y axes.ZoomButtons - Gets or sets a value that determines which mouse button will be used as a primary option to trigger a zoom event.ZoomButtons2 - Gets or sets a value that determines which mouse button will be used as the secondary option to trigger a zoom event.ZoomEvent - Subscribe to this event to be notified when the GraphPane is zoomed or panned by the user, either via a mouse drag operation or by the context menu commands.ZoomModifierKeys - Gets or sets a value that determines which modifier keys will be used as a primary option to trigger a zoom event.ZoomModifierKeys2 - Gets or sets a value that determines which modifier keys will be used as a secondary option to trigger a zoom event.ZoomOut(GraphPane) - Handler for the UnZoom/UnPan context menu item. Restores the scale ranges to the values before the last zoom, pan, or scroll operation.ZoomOutAll(GraphPane) - Handler for the Undo All Zoom/Pan context menu item. Restores the scale ranges to the values before all zoom and pan operationsZoomPane(GraphPane, Double, PointF, Boolean) - Zoom a specified pane in or out according to the specified zoom fraction.ZoomStepFraction - Gets or sets the step size fraction for zooming with the mouse wheel. A value of 0.1 will result in a 10% zoom step for each mouse wheel movement.Axis Class 坐标轴信息 Member - DescriptionAxisGap - The size of the gap between multiple axes (see YAxisList and Y2AxisList).CalcSpace(Graphics, GraphPane, Single, Single%) - Calculate the space required (pixels) for this Axis object.Color - The color to use for drawing this Axis.Cross - Gets or sets the scale value at which this axis should cross the other axis.CrossAuto - Gets or sets a value that determines whether or not the Cross value is set automatically.Draw(Graphics, GraphPane, Single, Single) - Do all rendering associated with this Axis to the specified Graphics device.DrawMinorTics(Graphics, GraphPane, Double, Single, Single, Single) - Draw the minor tic marks as required for this Axis.DrawTitle(Graphics, GraphPane, Single, Single) - Draw the title for this Axis.GetCrossAxis(GraphPane) - Gets the Cross axis that corresponds to this axis.GetObjectData(SerializationInfo, StreamingContext) - Populates a SerializationInfoinstance with the data needed to serialize the target objectIsAxisSegmentVisible - Gets or sets a property that determines whether or not the axis segment (the line that represents the axis itself) is drawn.IsVisible - 是否可见。MajorGrid - 见下面相关内容。MajorTic - 见下面相关内容。MinorGrid - 见下面相关内容。MinorTic - 见下面相关内容。MinSpace - Gets or sets the minimum axis space allocation.ResetAutoScale(GraphPane, Graphics) - Restore the scale ranging to automatic mode, and recalculate the Axis scale rangesScale - Gets the Scale instance associated with this Axis.ScaleFormatEvent - Subscribe to this event to handle custom formatting of the scale labels.ScaleTitleEvent - Allow customization of the title when the scale is very large Subscribe to this event to handle custom formatting of the scale axis label.SetMinSpaceBuffer(Graphics, GraphPane, Single, Boolean) - This method will set the MinSpace property for this Axis using the currently required space multiplied by a fraction ().SetTransformMatrix(Graphics, GraphPane, Single) - Setup the Transform Matrix to handle drawing of this AxisICloneable.:Clone()()Implement the ICloneableinterface in a typesafe manner by just calling the typed version of Clone.TagA tag object for use by the user. This can be used to store additional information associated with the Axis. ZedGraph does not use this value for any purpose.TitleGets or sets the Label class that contains the title of this Axis.TypeGets or sets the AxisType for this Axis.MinorGridMajorGrid 小刻度和大刻度的虚线的,显示在图表中用来分割图表的。默认IsVisible是False,看不到效果。 Member - DescriptionColor - 线的颜色。DashOff - 点线中点与点之间的间隔。DashOn - 点线中点的长度。IsVisible - 是否可见。PenWidth - 画笔宽度。MinorTicMajorTic 坐标轴上小刻度和大刻度的线的设置。 Member - DescriptionColor - 刻度线的颜色。IsAllTics - This is convenience property sets the status of all the different tic properties in this instance to the same value. true to activate all tics, false to clear all tics.IsCrossInside - Gets or sets the display mode for the Axis major inside cross tic marks.IsCrossOutside - Gets or sets the display mode for the Axis major outside cross tic marks.IsInside - 刻度条是否要显示到坐标轴的里边。IsOpposite - 对面的坐标轴是否显示该刻度。IsOutside - 刻度条是否要显示到坐标轴的外边。PenWidth - 画笔宽度。ScaledTic(Single) - Calculate the scaled tic size for this AxisSize - 刻度线的长度。Scale 刻度值相关 Member - DescriptionAlign - Controls the alignment of the Axis tic labels.AlignH - Controls the alignment of the Axis tic labels.BaseTic - 第一个刻度从哪个值开始。CalcMaxLabels(Graphics, GraphPane, Single) - Calculate the maximum number of labels that will fit on this axis.DeLinearize(Double) - Convert a value from its linear equivalent to its actual scale value for this type of scale.Exponent - Gets or sets the scale exponent value. This only applies to Exponent.FontSpec - 刻度值的字体属性。Format - 刻度值的格式化,string类型。FormatAuto - 为true时自动设置Format属性,注意设置Format属性时该属性自动变为FalseGetClusterWidth(GraphPane) - Determine the width, in pixel units, of each bar clu

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论