Class OHLCBar
This class handles the drawing of the curve OHLCBar objects.
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class OHLCBar : LineBase, ICloneable, ISerializable
Constructors
| Improve this Doc View SourceOHLCBar()
Default constructor that sets all OHLCBar properties to default values as defined in the OHLCBar.Default class.
Declaration
public OHLCBar()
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 |
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 |
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 |
_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 |
_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 |
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 SourceIsAutoSize
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 |
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
| Improve this Doc View SourceSize
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
Methods
| Improve this Doc View SourceClone()
Typesafe, deep-copy clone method.
Declaration
public OHLCBar Clone()
Returns
Type | Description |
---|---|
OHLCBar | A new, independent copy of this class |
Draw(Graphics, GraphPane, Boolean, Single, Single, Single, Single, Single, Single, Pen)
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 |
Draw(Graphics, GraphPane, OHLCBarItem, Axis, Axis, Single)
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. |
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 |
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
Explicit Interface Implementations
| Improve this Doc View SourceICloneable.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 |