NPlot::CandlePlot Class Reference

Encapsulates functionality for drawing finacial candle charts. More...

Inheritance diagram for NPlot::CandlePlot:

NPlot::BasePlot NPlot::IPlot NPlot::IDrawable List of all members.

Public Types

enum  Styles { Stick, Filled }
 Possible CandleStick styles. More...

Public Member Functions

 CandlePlot ()
 Default constructor.
void Draw (Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis)
 Draws the candle plot on a GDI+ surface agains the provided x and y axes.
Axis SuggestXAxis ()
 Returns an x-axis that is suitable for drawing this plot.
Axis SuggestYAxis ()
 Returns a y-axis that is suitable for drawing this plot.
virtual void DrawInLegend (Graphics g, Rectangle startEnd)
 Draws a representation of this plot in the legend.
void WriteData (System.Text.StringBuilder sb, RectangleD region, bool onlyInRegion)
 Write data associated with the plot as text.

Properties

object OpenData
 Gets or sets the data, or column name for the open values.
object openData_ = null
object LowData
 Gets or sets the data, or column name for the interval low values.
object lowData_ = null
object HighData
 Gets or sets the data, or column name for the interval high values.
object highData_ = null
object CloseData
 Gets or sets the data, or column name for the close values.
object closeData_ = null
object AbscissaData
 Gets or sets the data, or column name for the abscissa [x] axis.
object abscissaData_ = null
System.Drawing.Color Color
 Color of this plot [excluding interior of filled boxes if Style is fill].
Color color_ = Color.Black
Styles Style = Styles.Filled
 Specifies the CandleStick style to use.
Color BullishColor = Color.White
 If CandlePlot.Style is Filled, then bullish open-close moves are displayed in this color.
Color BearishColor = Color.Black
 If CandlePlot.Style is Filled, then bearish moves are displayed in this color.
int StickWidth
 Width of each stick in pixels.
int stickWidth_ = AutoScaleStickWidth
const int AutoScaleStickWidth = 0
 If stick width is set equal to this value, the width will be automatically scaled dependant on the space between sticks.
bool Centered
 If true (default), bars will be centered on the abscissa times.
bool centered_ = true

Static Private Member Functions

static float CalculatePhysicalSeparation (CandleDataAdapter cd, PhysicalAxis xAxis)
 Calculates the physical (not world) separation between abscissa values.

Classes

class  CandleDataAdapter
class  CandleStyle
class  Stick

Detailed Description

Encapsulates functionality for drawing finacial candle charts.

Definition at line 175 of file CandlePlot.cs.


Member Enumeration Documentation

enum NPlot::CandlePlot::Styles
 

Possible CandleStick styles.

Enumerator:
Stick  Draw vertical line between low and high, tick on left for open and tick on right for close.
Filled  Draw vertical line between low and high and place on top of this a box with bottom and top determined by open and high values.

The box is filled using the colors specified in BullishColor and BearishColor properties.

Definition at line 748 of file CandlePlot.cs.


Constructor & Destructor Documentation

NPlot::CandlePlot::CandlePlot  )  [inline]
 

Default constructor.

Definition at line 458 of file CandlePlot.cs.


Member Function Documentation

static float NPlot::CandlePlot::CalculatePhysicalSeparation CandleDataAdapter  cd,
PhysicalAxis  xAxis
[inline, static, private]
 

Calculates the physical (not world) separation between abscissa values.

Parameters:
cd Candle adapter containing data
xAxis Physical x axis the data is plotted against.
Returns:
physical separation between abscissa values.

Definition at line 469 of file CandlePlot.cs.

References NPlot::CandlePlot::CandleDataAdapter::Count, and NPlot::PhysicalAxis::WorldToPhysical().

Referenced by Draw().

void NPlot::CandlePlot::Draw Graphics  g,
PhysicalAxis  xAxis,
PhysicalAxis  yAxis
[inline]
 

Draws the candle plot on a GDI+ surface agains the provided x and y axes.

Parameters:
g The GDI+ surface on which to draw.
xAxis The X-Axis to draw against.
yAxis The Y-Axis to draw against.

Implements NPlot::IDrawable.

Definition at line 496 of file CandlePlot.cs.

References AbscissaData, AutoScaleStickWidth, BearishColor, BullishColor, CalculatePhysicalSeparation(), centered_, NPlot::PointOLHC::Close, CloseData, color_, NPlot::CandlePlot::CandleDataAdapter::Count, NPlot::BasePlot::DataMember, NPlot::BasePlot::DataSource, NPlot::PointOLHC::High, HighData, NPlot::PointOLHC::Low, LowData, NPlot::PointOLHC::Open, OpenData, StickWidth, Style, NPlot::PhysicalAxis::WorldToPhysical(), and NPlot::PointOLHC::X.

virtual void NPlot::CandlePlot::DrawInLegend Graphics  g,
Rectangle  startEnd
[inline, virtual]
 

Draws a representation of this plot in the legend.

Parameters:
g The graphics surface on which to draw.
startEnd A rectangle specifying the bounds of the area in the legend set aside for drawing.

Implements NPlot::IPlot.

Definition at line 716 of file CandlePlot.cs.

References color_.

Axis NPlot::CandlePlot::SuggestXAxis  )  [inline]
 

Returns an x-axis that is suitable for drawing this plot.

Returns:
A suitable x-axis.

Implements NPlot::IPlot.

Definition at line 604 of file CandlePlot.cs.

References AbscissaData, CloseData, NPlot::BasePlot::DataMember, NPlot::BasePlot::DataSource, HighData, LowData, OpenData, and NPlot::CandlePlot::CandleDataAdapter::SuggestXAxis().

Axis NPlot::CandlePlot::SuggestYAxis  )  [inline]
 

Returns a y-axis that is suitable for drawing this plot.

Returns:
A suitable y-axis.

Implements NPlot::IPlot.

Definition at line 617 of file CandlePlot.cs.

References AbscissaData, CloseData, NPlot::BasePlot::DataMember, NPlot::BasePlot::DataSource, HighData, LowData, OpenData, and NPlot::CandlePlot::CandleDataAdapter::SuggestYAxis().

void NPlot::CandlePlot::WriteData System.Text.StringBuilder  sb,
RectangleD  region,
bool  onlyInRegion
[inline]
 

Write data associated with the plot as text.

Parameters:
sb the string builder to write to.
region Only write out data in this region if onlyInRegion is true.
onlyInRegion If true, only data in region is written, else all data is written.
TODO: not implemented.

Implements NPlot::IPlot.

Definition at line 838 of file CandlePlot.cs.


Property Documentation

object NPlot::CandlePlot::AbscissaData [get, set]
 

Gets or sets the data, or column name for the abscissa [x] axis.

Definition at line 698 of file CandlePlot.cs.

Referenced by Draw(), SuggestXAxis(), and SuggestYAxis().

object NPlot::CandlePlot::abscissaData_ = null [private]
 

Definition at line 708 of file CandlePlot.cs.

const int NPlot::CandlePlot::AutoScaleStickWidth = 0
 

If stick width is set equal to this value, the width will be automatically scaled dependant on the space between sticks.

Definition at line 809 of file CandlePlot.cs.

Referenced by Draw().

Color NPlot::CandlePlot::BearishColor = Color.Black
 

If CandlePlot.Style is Filled, then bearish moves are displayed in this color.

Definition at line 781 of file CandlePlot.cs.

Referenced by Draw().

Color NPlot::CandlePlot::BullishColor = Color.White
 

If CandlePlot.Style is Filled, then bullish open-close moves are displayed in this color.

Definition at line 775 of file CandlePlot.cs.

Referenced by Draw().

bool NPlot::CandlePlot::Centered [get, set]
 

If true (default), bars will be centered on the abscissa times.

If false, bars will be drawn between the corresponding abscissa time and the next abscissa time.

Definition at line 818 of file CandlePlot.cs.

bool NPlot::CandlePlot::centered_ = true [private]
 

Definition at line 828 of file CandlePlot.cs.

Referenced by Draw().

object NPlot::CandlePlot::CloseData [get, set]
 

Gets or sets the data, or column name for the close values.

Definition at line 681 of file CandlePlot.cs.

Referenced by Draw(), SuggestXAxis(), and SuggestYAxis().

object NPlot::CandlePlot::closeData_ = null [private]
 

Definition at line 691 of file CandlePlot.cs.

System.Drawing.Color NPlot::CandlePlot::Color [get, set]
 

Color of this plot [excluding interior of filled boxes if Style is fill].

To change the Bullish and Bearish colours in Filled mode, use the BullishColor and BearishColor properties.

Definition at line 732 of file CandlePlot.cs.

Color NPlot::CandlePlot::color_ = Color.Black [private]
 

Definition at line 742 of file CandlePlot.cs.

Referenced by Draw(), and DrawInLegend().

object NPlot::CandlePlot::HighData [get, set]
 

Gets or sets the data, or column name for the interval high values.

Definition at line 664 of file CandlePlot.cs.

Referenced by Draw(), SuggestXAxis(), and SuggestYAxis().

object NPlot::CandlePlot::highData_ = null [private]
 

Definition at line 674 of file CandlePlot.cs.

object NPlot::CandlePlot::LowData [get, set]
 

Gets or sets the data, or column name for the interval low values.

Definition at line 647 of file CandlePlot.cs.

Referenced by Draw(), SuggestXAxis(), and SuggestYAxis().

object NPlot::CandlePlot::lowData_ = null [private]
 

Definition at line 657 of file CandlePlot.cs.

object NPlot::CandlePlot::OpenData [get, set]
 

Gets or sets the data, or column name for the open values.

Definition at line 630 of file CandlePlot.cs.

Referenced by Draw(), SuggestXAxis(), and SuggestYAxis().

object NPlot::CandlePlot::openData_ = null [private]
 

Definition at line 640 of file CandlePlot.cs.

int NPlot::CandlePlot::StickWidth [get, set]
 

Width of each stick in pixels.

It is best if this is an odd number.

Definition at line 788 of file CandlePlot.cs.

Referenced by Draw().

int NPlot::CandlePlot::stickWidth_ = AutoScaleStickWidth [private]
 

Definition at line 802 of file CandlePlot.cs.

Styles NPlot::CandlePlot::Style = Styles.Filled
 

Specifies the CandleStick style to use.

Definition at line 769 of file CandlePlot.cs.

Referenced by Draw().


The documentation for this class was generated from the following file:
Generated on Sat Nov 5 01:04:08 2005 for NPlot by  doxygen 1.4.5