Search Results for

    Show / Hide Table of Contents

    Class GraphObj

    An abstract base class that represents a text object on the graph. A list of GraphObj objects is maintained by the GraphObjList collection class.

    Inheritance
    Object
    GraphObj
    BoxObj
    ImageObj
    LineObj
    TextObj
    Implements
    ISerializable
    ICloneable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: ZedGraph
    Assembly: ZedGraph.dll
    Syntax
    [Serializable]
    public abstract class GraphObj : ISerializable, ICloneable

    Constructors

    | Improve this Doc View Source

    GraphObj()

    Default constructor that sets all GraphObj properties to default values as defined in the GraphObj.Default class.

    Declaration
    public GraphObj()
    | Improve this Doc View Source

    GraphObj(Double, Double)

    Constructor that sets all GraphObj properties to default values as defined in the GraphObj.Default class.

    Declaration
    public GraphObj(double x, double y)
    Parameters
    Type Name Description
    Double x

    The x position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignH property.

    Double y

    The y position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignV property.

    | Improve this Doc View Source

    GraphObj(Double, Double, Double, Double)

    Constructor that creates a GraphObj with the specified coordinates and all other properties to defaults as specified in the GraphObj.Default class..

    Declaration
    public GraphObj(double x, double y, double x2, double y2)
    Parameters
    Type Name Description
    Double x

    The x position of the item.

    Double y

    The y position of the item.

    Double x2

    The x2 position of the item.

    Double y2

    The x2 position of the item.

    Remarks

    The four coordinates define the starting point and ending point for ArrowObj's, or the topleft and bottomright points for ImageObj's. For GraphObj's that only require one point, the and values will be ignored. The units of the coordinates are specified by the CoordinateFrame property.

    | Improve this Doc View Source

    GraphObj(Double, Double, Double, Double, CoordType, AlignH, AlignV)

    Constructor that creates a GraphObj with the specified position, CoordType, AlignH, and AlignV. Other properties are set to default values as defined in the GraphObj.Default class.

    Declaration
    public GraphObj(double x, double y, double x2, double y2, CoordType coordType, AlignH alignH, AlignV alignV)
    Parameters
    Type Name Description
    Double x

    The x position of the item.

    Double y

    The y position of the item.

    Double x2

    The x2 position of the item.

    Double y2

    The x2 position of the item.

    CoordType coordType

    The CoordType enum value that indicates what type of coordinate system the x and y parameters are referenced to.

    AlignH alignH

    The AlignH enum that specifies the horizontal alignment of the object with respect to the (x,y) location

    AlignV alignV

    The AlignV enum that specifies the vertical alignment of the object with respect to the (x,y) location

    Remarks

    The four coordinates define the starting point and ending point for ArrowObj's, or the topleft and bottomright points for ImageObj's. For GraphObj's that only require one point, the and values will be ignored. The units of the coordinates are specified by the CoordinateFrame property.

    | Improve this Doc View Source

    GraphObj(Double, Double, CoordType)

    Constructor that creates a GraphObj with the specified position and CoordType. Other properties are set to default values as defined in the GraphObj.Default class.

    Declaration
    public GraphObj(double x, double y, CoordType coordType)
    Parameters
    Type Name Description
    Double x

    The x position of the item. The item will be aligned to this position based on the AlignH property.

    Double y

    The y position of the item. The item will be aligned to this position based on the AlignV property.

    CoordType coordType

    The CoordType enum value that indicates what type of coordinate system the x and y parameters are referenced to.

    Remarks

    The two coordinates define the location point for the object. The units of the coordinates are specified by the CoordinateFrame property.

    | Improve this Doc View Source

    GraphObj(Double, Double, CoordType, AlignH, AlignV)

    Constructor that creates a GraphObj with the specified position, CoordType, AlignH, and AlignV. Other properties are set to default values as defined in the GraphObj.Default class.

    Declaration
    public GraphObj(double x, double y, CoordType coordType, AlignH alignH, AlignV alignV)
    Parameters
    Type Name Description
    Double x

    The x position of the item. The item will be aligned to this position based on the AlignH property.

    Double y

    The y position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignV property.

    CoordType coordType

    The CoordType enum value that indicates what type of coordinate system the x and y parameters are referenced to.

    AlignH alignH

    The AlignH enum that specifies the horizontal alignment of the object with respect to the (x,y) location

    AlignV alignV

    The AlignV enum that specifies the vertical alignment of the object with respect to the (x,y) location

    Remarks

    The two coordinates define the location point for the object. The units of the coordinates are specified by the CoordinateFrame property.

    | Improve this Doc View Source

    GraphObj(SerializationInfo, StreamingContext)

    Constructor for deserializing objects

    Declaration
    protected GraphObj(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    SerializationInfo info

    A SerializationInfo instance that defines the serialized data

    StreamingContext context

    A StreamingContext instance that contains the serialized data

    | Improve this Doc View Source

    GraphObj(GraphObj)

    The Copy Constructor

    Declaration
    public GraphObj(GraphObj rhs)
    Parameters
    Type Name Description
    GraphObj rhs

    The GraphObj object from which to copy

    Fields

    | Improve this Doc View Source

    _isClippedToChartRect

    Protected field that determines whether or not the rendering of this GraphObj will be clipped to the ChartRect. Use the public property IsClippedToChartRect to access this value.

    Declaration
    [CLSCompliant(false)]
    protected bool _isClippedToChartRect
    Field Value
    Type Description
    Boolean
    | Improve this Doc View Source

    _isVisible

    Protected field that determines whether or not this GraphObj is visible in the graph. Use the public property IsVisible to access this value.

    Declaration
    [CLSCompliant(false)]
    protected bool _isVisible
    Field Value
    Type Description
    Boolean
    | Improve this Doc View Source

    _location

    Protected field that stores the location of this GraphObj. Use the public property Location to access this value.

    Declaration
    [CLSCompliant(false)]
    protected Location _location
    Field Value
    Type Description
    Location
    | Improve this Doc View Source

    schema

    Current schema value that defines the version of the serialized file

    Declaration
    public const int schema = 10
    Field Value
    Type Description
    Int32
    Remarks

    schema changed to 2 when isClippedToChartRect was added.

    | Improve this Doc View Source

    Tag

    A tag object for use by the user. This can be used to store additional information associated with the GraphObj. ZedGraph does not use this value for any purpose.

    Declaration
    public object Tag
    Field Value
    Type Description
    Object
    Remarks

    Note that, if you are going to Serialize ZedGraph data, then any type that you store in Tag must be a serializable type (or it will cause an exception).

    Properties

    | Improve this Doc View Source

    IsClippedToChartRect

    Gets or sets a value that determines whether or not the rendering of this GraphObj will be clipped to the Rect.

    Declaration
    public bool IsClippedToChartRect { get; set; }
    Property Value
    Type Description
    Boolean

    true to clip the GraphObj to the Rect bounds, false to leave it unclipped.

    | Improve this Doc View Source

    IsInFrontOfData

    true if the ZOrder of this object is set to put it in front of the CurveItem data points.

    Declaration
    public bool IsInFrontOfData { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsVisible

    Gets or sets a value that determines if this GraphObj will be visible in the graph. true displays the item, false hides it.

    Declaration
    public bool IsVisible { get; set; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Link

    Gets or sets the hyperlink information for this GraphObj.

    Declaration
    public Link Link { get; set; }
    Property Value
    Type Description
    Link
    | Improve this Doc View Source

    Location

    The Location struct that describes the location for this GraphObj.

    Declaration
    public Location Location { get; set; }
    Property Value
    Type Description
    Location
    | Improve this Doc View Source

    ZOrder

    Gets or sets a value that determines the z-order "depth" of this item relative to other graphic objects.

    Declaration
    public ZOrder ZOrder { get; set; }
    Property Value
    Type Description
    ZOrder
    Remarks

    Note that this controls the z-order with respect to other elements such as CurveItem's, Axis objects, etc. The order of GraphObj objects having the same ZOrder value is controlled by their order in the GraphObjList. The first GraphObj in the list is drawn in front of other GraphObj objects having the same ZOrder value.

    Methods

    | Improve this Doc View Source

    Draw(Graphics, PaneBase, Single)

    Render this GraphObj object to the specified Graphics device.

    Declaration
    public abstract void Draw(Graphics g, PaneBase pane, float scaleFactor)
    Parameters
    Type Name Description
    Graphics g

    A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method.

    PaneBase pane

    A reference to the PaneBase object that is the parent or owner of this object.

    Single scaleFactor

    The scaling factor to be used for rendering objects. This is calculated and passed down by the parent PaneBase object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph.

    Remarks

    This method is normally only called by the Draw method of the parent GraphObjList collection object.

    | Improve this Doc View Source

    GetCoords(PaneBase, Graphics, Single, out String, out String)

    Determines the shape type and Coords values for this GraphObj

    Declaration
    public abstract void GetCoords(PaneBase pane, Graphics g, float scaleFactor, out string shape, out string coords)
    Parameters
    Type Name Description
    PaneBase pane
    Graphics g
    Single scaleFactor
    String shape
    String coords
    | Improve this Doc View Source

    GetObjectData(SerializationInfo, StreamingContext)

    Populates a SerializationInfo instance with the data needed to serialize the target object

    Declaration
    [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
    public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    SerializationInfo info

    A SerializationInfo instance that defines the serialized data

    StreamingContext context

    A StreamingContext instance that contains the serialized data

    | Improve this Doc View Source

    PointInBox(PointF, PaneBase, Graphics, Single)

    Determine if the specified screen point lies inside the bounding box of this GraphObj.

    Declaration
    public virtual bool PointInBox(PointF pt, PaneBase pane, Graphics g, float scaleFactor)
    Parameters
    Type Name Description
    PointF pt

    The screen point, in pixels

    PaneBase pane

    A reference to the PaneBase object that is the parent or owner of this object.

    Graphics g

    A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method.

    Single scaleFactor

    The scaling factor to be used for rendering objects. This is calculated and passed down by the parent PaneBase object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph.

    Returns
    Type Description
    Boolean

    true if the point lies in the bounding box, false otherwise

    Explicit Interface Implementations

    | Improve this Doc View Source

    ICloneable.Clone()

    Implement the ICloneable interface in a typesafe manner by just calling the typed version of Clone.

    Declaration
    object ICloneable.Clone()
    Returns
    Type Description
    Object

    A deep copy of this object

    Remarks

    Note that this method must be called with an explicit cast to ICloneable, and that it is inherently virtual. For example:

    ParentClass foo = new ChildClass();
    ChildClass bar = (ChildClass) ((ICloneable)foo).Clone();

    Assume that ChildClass is inherited from ParentClass. Even though foo is declared with ParentClass, it is actually an instance of ChildClass. Calling the ICloneable implementation of Clone() on foo actually calls ChildClass.Clone() as if it were a virtual function.

    Implements

    System.Runtime.Serialization.ISerializable
    System.ICloneable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX