Search Results for

    Show / Hide Table of Contents

    Class OHLCBar

    This class handles the drawing of the curve OHLCBar objects.

    Inheritance
    Object
    LineBase
    OHLCBar
    JapaneseCandleStick
    Implements
    ICloneable
    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)
    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 class OHLCBar : LineBase, ICloneable, ISerializable

    Constructors

    | Improve this Doc View Source

    OHLCBar()

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

    Declaration
    public OHLCBar()
    | Improve this Doc View Source

    OHLCBar(Color)

    Default constructor that sets the Color as specified, and the remaining OHLCBar properties to default values as defined in the OHLCBar.Default class.

    Declaration
    public OHLCBar(Color color)
    Parameters
    Type Name Description
    Color color

    A Color value indicating the color of the symbol

    | Improve this Doc View Source

    OHLCBar(SerializationInfo, StreamingContext)

    Constructor for deserializing objects

    Declaration
    protected OHLCBar(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

    OHLCBar(OHLCBar)

    The Copy Constructor

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

    The OHLCBar object from which to copy

    Fields

    | Improve this Doc View Source

    _isAutoSize

    Private field that determines if the Size property will be calculated automatically based on the minimum axis scale step size between bars. Use the public property IsAutoSize to access this value.

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

    _isOpenCloseVisible

    Private field that stores the visibility of the OHLCBar open and close line segments ("wings"). Use the public property IsOpenCloseVisible to access this value. If this value is false, the wings will not be shown.

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

    _size

    Private field that stores the total width for the Opening/Closing line segments. Use the public property Size to access this value.

    Declaration
    [CLSCompliant(false)]
    protected float _size
    Field Value
    Type Description
    Single
    | 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

    Properties

    | Improve this Doc View Source

    IsAutoSize

    Gets or sets a value that determines if the Size property will be calculated automatically based on the minimum axis scale step size between bars.

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

    IsOpenCloseVisible

    Gets or sets a property that shows or hides the OHLCBar open/close "wings".

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

    true to show the CandleStick wings, false to hide them

    See Also
    IsOpenCloseVisible
    | Improve this Doc View Source

    Size

    Gets or sets the total width to be used for drawing the opening/closing line segments ("wings") of the OHLCBar items. Units are points.

    Declaration
    public float Size { get; set; }
    Property Value
    Type Description
    Single

    Size in points (1/72 inch)

    Remarks

    The size of the candlesticks can be set by this value, which is then scaled according to the scaleFactor (see CalcScaleFactor()). Alternatively, if IsAutoSize is true, the bar width will be set according to the maximum available cluster width less the cluster gap (see GetClusterWidth() and MinClusterGap). That is, if IsAutoSize is true, then the value of Size will be ignored. If you modify the value of Size, then IsAutoSize will be automatically set to false.

    See Also
    Size

    Methods

    | Improve this Doc View Source

    Clone()

    Typesafe, deep-copy clone method.

    Declaration
    public OHLCBar Clone()
    Returns
    Type Description
    OHLCBar

    A new, independent copy of this class

    | Improve this Doc View Source

    Draw(Graphics, GraphPane, Boolean, Single, Single, Single, Single, Single, Single, Pen)

    Draw the OHLCBar to the specified Graphics device at the specified location.

    Declaration
    public void Draw(Graphics g, GraphPane pane, bool isXBase, float pixBase, float pixHigh, float pixLow, float pixOpen, float pixClose, float halfSize, Pen pen)
    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.

    GraphPane pane

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

    Boolean isXBase

    boolean value that indicates if the "base" axis for this OHLCBar is the X axis. True for an XAxis base, false for a YAxis or Y2Axis base.

    Single pixBase

    The independent axis position of the center of the candlestick in pixel units

    Single pixHigh

    The dependent axis position of the top of the candlestick in pixel units

    Single pixLow

    The dependent axis position of the bottom of the candlestick in pixel units

    Single pixOpen

    The dependent axis position of the opening value of the candlestick in pixel units

    Single pixClose

    The dependent axis position of the closing value of the candlestick in pixel units

    Single halfSize

    The scaled width of the candlesticks, pixels

    Pen pen

    A pen with attributes of Color and Width for this OHLCBar

    | Improve this Doc View Source

    Draw(Graphics, GraphPane, OHLCBarItem, Axis, Axis, Single)

    Draw all the OHLCBar's to the specified Graphics device as a candlestick at each defined point.

    Declaration
    public void Draw(Graphics g, GraphPane pane, OHLCBarItem curve, Axis baseAxis, Axis valueAxis, 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.

    GraphPane pane

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

    OHLCBarItem curve

    A OHLCBarItem object representing the OHLCBar's to be drawn.

    Axis baseAxis

    The Axis class instance that defines the base (independent) axis for the OHLCBar

    Axis valueAxis

    The Axis class instance that defines the value (dependent) axis for the OHLCBar

    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

    GetBarWidth(GraphPane, Axis, Single)

    Returns the width of the candleStick, in pixels, based on the settings for Size and IsAutoSize.

    Declaration
    public float GetBarWidth(GraphPane pane, Axis baseAxis, float scaleFactor)
    Parameters
    Type Name Description
    GraphPane pane

    The parent GraphPane object.

    Axis baseAxis

    The Axis object that represents the bar base (independent axis).

    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.

    Returns
    Type Description
    Single

    The width of each bar, in pixel units

    | 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 override 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

    Overrides
    LineBase.GetObjectData(SerializationInfo, StreamingContext)

    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

    Implements

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