Search Results for

    Show / Hide Table of Contents

    Class Line

    A class representing all the characteristics of the Line segments that make up a curve on the graph.

    Inheritance
    System.Object
    LineBase
    Line
    Implements
    System.ICloneable
    System.Runtime.Serialization.ISerializable
    Inherited Members
    LineBase.Color
    LineBase.Style
    LineBase.DashOn
    LineBase.DashOff
    LineBase.Width
    LineBase.IsVisible
    LineBase.IsAntiAlias
    LineBase.GradientFill
    LineBase.schema0
    LineBase.GetPen(PaneBase, Single)
    LineBase.GetPen(PaneBase, Single, PointPair)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: ZedGraph
    Assembly: ZedGraph.dll
    Syntax
    [Serializable]
    public class Line : LineBase, ICloneable, ISerializable

    Constructors

    | Improve this Doc View Source

    Line()

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

    Declaration
    public Line()
    | Improve this Doc View Source

    Line(Color)

    Constructor that sets the color property to the specified value, and sets the remaining Line properties to default values as defined in the Line.Default class.

    Declaration
    public Line(Color color)
    Parameters
    Type Name Description
    System.Drawing.Color color

    The color to assign to this new Line object

    | Improve this Doc View Source

    Line(SerializationInfo, StreamingContext)

    Constructor for deserializing objects

    Declaration
    protected Line(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    A System.Runtime.Serialization.SerializationInfo instance that defines the serialized data

    System.Runtime.Serialization.StreamingContext context

    A System.Runtime.Serialization.StreamingContext instance that contains the serialized data

    | Improve this Doc View Source

    Line(Line)

    The Copy Constructor

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

    The Line object from which to copy

    Fields

    | Improve this Doc View Source

    schema

    Current schema value that defines the version of the serialized file

    Declaration
    public const int schema = 14
    Field Value
    Type Description
    System.Int32

    Properties

    | Improve this Doc View Source

    Fill

    Gets or sets the Fill data for this Line.

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

    IsOptimizedDraw

    Gets or sets a boolean value that determines if this Line will be drawn with optimizations enabled.

    Declaration
    public bool IsOptimizedDraw { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Normally, the optimizations can be used without a problem, especially if the data are sorted. The optimizations are particularly helpful with very large datasets. However, if the data are very discontinuous (for example, a curve that doubles back on itself), then the optimizations can cause drawing artifacts in the form of missing line segments. The default option for this mode is false, so you must explicitly enable it for each Line. Also note that, even if the optimizations are enabled explicitly, no actual optimization will be done for datasets of less than 1000 points.

    | Improve this Doc View Source

    IsSmooth

    Gets or sets a property that determines if this Line will be drawn smooth. The "smoothness" is controlled by the SmoothTension property.

    Declaration
    public bool IsSmooth { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to smooth the line, false to just connect the dots with linear segments

    See Also
    SmoothTension
    IsSmooth
    SmoothTension
    | Improve this Doc View Source

    SmoothTension

    Gets or sets a property that determines the smoothing tension for this Line. This property is only used if IsSmooth is true. A tension value 0.0 will just draw ordinary line segments like an unsmoothed line. A tension value of 1.0 will be smooth. Values greater than 1.0 will generally give odd results.

    Declaration
    public float SmoothTension { get; set; }
    Property Value
    Type Description
    System.Single

    A floating point value indicating the level of smoothing. 0.0F for no smoothing, 1.0F for lots of smoothing, >1.0 for odd smoothing.

    See Also
    IsSmooth
    IsSmooth
    SmoothTension
    | Improve this Doc View Source

    StepType

    Determines if the CurveItem will be drawn by directly connecting the points from the Points data collection, or if the curve will be a "stair-step" in which the points are connected by a series of horizontal and vertical lines that represent discrete, constant values. Note that the values can be forward oriented ForwardStep (StepType) or rearward oriented RearwardStep. That is, the points are defined at the beginning or end of the constant value for which they apply, respectively. The StepType property is ignored for lines that have IsSmooth set to true.

    Declaration
    public StepType StepType { get; set; }
    Property Value
    Type Description
    StepType

    StepType enum value

    See Also
    StepType

    Methods

    | Improve this Doc View Source

    BuildLowPointsArray(GraphPane, CurveItem, out PointF[], out Int32)

    Build an array of System.Drawing.PointF values (pixel coordinates) that represents the low values for the current curve.

    Declaration
    public bool BuildLowPointsArray(GraphPane pane, CurveItem curve, out PointF[] arrPoints, out int count)
    Parameters
    Type Name Description
    GraphPane pane

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

    CurveItem curve

    A LineItem representing this curve.

    System.Drawing.PointF[] arrPoints

    An array of System.Drawing.PointF values in pixel coordinates representing the current curve.

    System.Int32 count

    The number of points contained in the "arrPoints" parameter.

    Returns
    Type Description
    System.Boolean

    true for a successful points array build, false for data problems

    Remarks

    Note that this drawing routine ignores Missing values, but it does not "break" the line to indicate values are missing.

    | Improve this Doc View Source

    BuildPointsArray(GraphPane, CurveItem, out PointF[], out Int32)

    Build an array of System.Drawing.PointF values (pixel coordinates) that represents the current curve. Note that this drawing routine ignores Missing values, but it does not "break" the line to indicate values are missing.

    Declaration
    public bool BuildPointsArray(GraphPane pane, CurveItem curve, out PointF[] arrPoints, out int count)
    Parameters
    Type Name Description
    GraphPane pane

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

    CurveItem curve

    A LineItem representing this curve.

    System.Drawing.PointF[] arrPoints

    An array of System.Drawing.PointF values in pixel coordinates representing the current curve.

    System.Int32 count

    The number of points contained in the "arrPoints" parameter.

    Returns
    Type Description
    System.Boolean

    true for a successful points array build, false for data problems

    | Improve this Doc View Source

    Clone()

    Typesafe, deep-copy clone method.

    Declaration
    public Line Clone()
    Returns
    Type Description
    Line

    A new, independent copy of this class

    | Improve this Doc View Source

    CloseCurve(GraphPane, CurveItem, PointF[], Int32, Double, GraphicsPath)

    Close off a System.Drawing.Drawing2D.GraphicsPath that defines a curve

    Declaration
    public void CloseCurve(GraphPane pane, CurveItem curve, PointF[] arrPoints, int count, double yMin, GraphicsPath path)
    Parameters
    Type Name Description
    GraphPane pane

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

    CurveItem curve

    A LineItem representing this curve.

    System.Drawing.PointF[] arrPoints

    An array of System.Drawing.PointF values in screen pixel coordinates representing the current curve.

    System.Int32 count

    The number of points contained in the "arrPoints" parameter.

    System.Double yMin

    The Y axis value location where the X axis crosses.

    System.Drawing.Drawing2D.GraphicsPath path

    The System.Drawing.Drawing2D.GraphicsPath class that represents the curve.

    | Improve this Doc View Source

    Draw(Graphics, GraphPane, CurveItem, Single)

    Do all rendering associated with this Line to the specified System.Drawing.Graphics device. This method is normally only called by the Draw method of the parent LineItem object.

    Declaration
    public void Draw(Graphics g, GraphPane pane, CurveItem curve, float scaleFactor)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

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

    GraphPane pane

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

    CurveItem curve

    A LineItem representing this curve.

    System.Single scaleFactor

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

    | Improve this Doc View Source

    DrawCurve(Graphics, GraphPane, CurveItem, Single)

    Draw the this CurveItem to the specified System.Drawing.Graphics device. The format (stair-step or line) of the curve is defined by the StepType property. The routine only draws the line segments; the symbols are drawn by the Draw(Graphics, GraphPane, LineItem, Single, Boolean) method. This method is normally only called by the Draw method of the CurveItem object

    Declaration
    public void DrawCurve(Graphics g, GraphPane pane, CurveItem curve, float scaleFactor)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

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

    GraphPane pane

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

    CurveItem curve

    A LineItem representing this curve.

    System.Single scaleFactor

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

    | Improve this Doc View Source

    DrawCurveOriginal(Graphics, GraphPane, CurveItem, Single)

    Draw the this CurveItem to the specified System.Drawing.Graphics device. The format (stair-step or line) of the curve is defined by the StepType property. The routine only draws the line segments; the symbols are drawn by the Draw(Graphics, GraphPane, LineItem, Single, Boolean) method. This method is normally only called by the Draw method of the CurveItem object

    Declaration
    public void DrawCurveOriginal(Graphics g, GraphPane pane, CurveItem curve, float scaleFactor)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

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

    GraphPane pane

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

    CurveItem curve

    A LineItem representing this curve.

    System.Single scaleFactor

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

    | Improve this Doc View Source

    DrawSegment(Graphics, GraphPane, Single, Single, Single, Single, Single)

    Render a single Line segment to the specified System.Drawing.Graphics device.

    Declaration
    public void DrawSegment(Graphics g, GraphPane pane, float x1, float y1, float x2, float y2, float scaleFactor)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

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

    GraphPane pane

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

    System.Single x1

    The x position of the starting point that defines the line segment in screen pixel units

    System.Single y1

    The y position of the starting point that defines the line segment in screen pixel units

    System.Single x2

    The x position of the ending point that defines the line segment in screen pixel units

    System.Single y2

    The y position of the ending point that defines the line segment in screen pixel units

    System.Single scaleFactor

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

    | Improve this Doc View Source

    DrawSmoothFilledCurve(Graphics, GraphPane, CurveItem, Single)

    Draw the this CurveItem to the specified System.Drawing.Graphics device using the specified smoothing property (SmoothTension). The routine draws the line segments and the area fill (if any, see FillType; the symbols are drawn by the Draw(Graphics, GraphPane, LineItem, Single, Boolean) method. This method is normally only called by the Draw method of the CurveItem object. Note that the StepType property is ignored for smooth lines (e.g., when IsSmooth is true).

    Declaration
    public void DrawSmoothFilledCurve(Graphics g, GraphPane pane, CurveItem curve, float scaleFactor)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

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

    GraphPane pane

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

    CurveItem curve

    A LineItem representing this curve.

    System.Single scaleFactor

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

    | Improve this Doc View Source

    DrawSticks(Graphics, GraphPane, CurveItem, Single)

    Render the Line's as vertical sticks (from a StickItem) to the specified System.Drawing.Graphics device.

    Declaration
    public void DrawSticks(Graphics g, GraphPane pane, CurveItem curve, float scaleFactor)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

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

    GraphPane pane

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

    CurveItem curve

    A CurveItem representing this curve.

    System.Single scaleFactor

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

    | Improve this Doc View Source

    GetObjectData(SerializationInfo, StreamingContext)

    Populates a System.Runtime.Serialization.SerializationInfo instance with the data needed to serialize the target object

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

    A System.Runtime.Serialization.SerializationInfo instance that defines the serialized data

    System.Runtime.Serialization.StreamingContext context

    A System.Runtime.Serialization.StreamingContext instance that contains the serialized data

    Overrides
    LineBase.GetObjectData(SerializationInfo, StreamingContext)

    Explicit Interface Implementations

    | Improve this Doc View Source

    ICloneable.Clone()

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

    Declaration
    object ICloneable.Clone()
    Returns
    Type Description
    System.Object

    A deep copy of this object

    Implements

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