com.steema.teechart.styles
Class Candle

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.styles.Series
          extended by com.steema.teechart.styles.CustomPoint
              extended by com.steema.teechart.styles.Custom
                  extended by com.steema.teechart.styles.OHLC
                      extended by com.steema.teechart.styles.Candle
All Implemented Interfaces:
ISeries, java.io.Serializable, java.lang.Cloneable

public class Candle
extends OHLC

Title: Candle class

Description: Candle Series.

Example:


 candleSeries = new com.steema.teechart.styles.Candle(myChart.getChart());
 candleSeries.fillSampleValues(30);
 candleSeries.getColors().setColor(11, Color.YELLOW);
 candleSeries.getColors().setColor(15, Color.LIME);
 candleSeries.getColors().setColor(16, Color.BLUE);
 candleSeries.repaint();
 

Copyright (c) 2005-2008 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.steema.teechart.styles.Series
Series.MarkTextResolver
 
Field Summary
protected  ChartPen linePen
           
protected  TreatNullsStyle treatnulls
           
 
Fields inherited from class com.steema.teechart.styles.OHLC
vHighValues, vLowValues, vOpenValues
 
Fields inherited from class com.steema.teechart.styles.Custom
bAreaBrush, bClickableLine, bDark3D, drawArea, drawLine, pAreaLines
 
Fields inherited from class com.steema.teechart.styles.CustomPoint
iStacked, point
 
Fields inherited from class com.steema.teechart.styles.Series
AUTODEPTH, AUTOZORDER, bActive, bBrush, bColorEach, calcVisiblePoints, colorMember, customMarkText, drawBetweenPoints, endZ, firstVisible, hasZValues, iColors, InternalUse, iNumSampleValues, iZOrder, labelMember, lastVisible, listenerList, mandatory, manualData, marks, middleZ, notMandatory, percentDecimal, percentFormat, sLabels, startZ, useAxis, useSeriesColor, valueFormat, vxValues, vyValues, yMandatory
 
Fields inherited from class com.steema.teechart.TeeBase
chart
 
Constructor Summary
Candle()
           
Candle(IBaseChart c)
           
 
Method Summary
 int clicked(int x, int y)
          Calculates if any point is at XY position.
 int clicked(java.awt.Point p)
           
 boolean clickedCandle(int valueIndex, java.awt.Point p)
           
 void createSubGallery(Gallery addSubChart)
           
 void drawValue(int valueIndex)
          Called internally.
 int getCandleWidth()
          The horizontal Candle Size in pixels.
It is based on pixels for Screen charts.
 java.lang.String getDescription()
          Gets descriptive text.
 Color getDownCloseColor()
          Candle color fill when Close value is greater than Open value.
By default, UpCloseColor is WHITE and DownCloseColor is RED.
 ChartPen getLinePen()
          Determines pen to draw the line connecting all points.
 double getMaxYValue()
          The Maximum Value of the Series Y Values List.
 double getMinYValue()
          The Minimum Value of the Series Y Values List.
As some Series have more than one Y Values List, this Minimum Value is the "Minimum of Minimums" of all Series Y Values lists.
 ChartPen getPen()
           
 boolean getShowClose()
          Determines whether Close prices will be displayed.
It only has effect when Candle series.CandleStyle is set to csCandleBar.
 boolean getShowOpen()
          Determines whether Open prices will be displayed.
It only has effect when Candle series.CandleStyle is set to csCandleBar.
 CandleStyle getStyle()
          Determines how the Candle points will be drawn.
When it is CandleStick, a vertical rectangle represents each candle point.
When it is CandleBar, a vertical line is drawn, among Open and Close horizontal tick marks.
You can control both the candle colors and width.
 TreatNullsStyle getTreatNulls()
          Defines how null points are treated.
 Color getUpCloseColor()
          Candle color fill when Open value is greater than Close value.
By default, UpCloseColor is WHITE and DownCloseColor is RED.
 void prepareForGallery(boolean isEnabled)
           
 void setCandleWidth(int value)
          Sets the horizontal Candle Size in pixels.
Default value: 6
 void setDownCloseColor(Color value)
          Candle color fill when Close value is greater than Open value.
Default value: red
 void setShowClose(boolean value)
          Determines whether Close prices will be displayed.
Default value: true
 void setShowOpen(boolean value)
          Determines whether Open prices will be displayed.
Default value: true
 void setStyle(CandleStyle value)
          Determines how the Candle points will be drawn.
Default value: CandleStick
 void setSubGallery(int index)
          Creates and prepares the index'th Series style to show at sub-gallery dialog.
 void setTreatNulls(TreatNullsStyle value)
           
 void setUpCloseColor(Color value)
          Candle color fill when Open value is greater than Close value.
Default value: white
 
Methods inherited from class com.steema.teechart.styles.OHLC
add, add, add, add, addSampleValues, calcMinMaxValue, getCloseValues, getDateValues, getHighValues, getLowValues, getOHLCPoint, getOpenValues, isValidSourceOf, numSampleValues, setCloseValues, setDateValues, setHighValues, setLowValues, setOpenValues
 
Methods inherited from class com.steema.teechart.styles.Custom
calcHorizMargins, calcVerticalMargins, draw, drawLegendShape, getAreaBrushColor, getBrush, getClickableLine, getColorEachLine, getDark3D, getInvertedStairs, getLineHeight, getOpacity, getOutLine, getStairs, getTransparency, readResolve, setChart, setClickableLine, setColor, setColorEachLine, setDark3D, setInvertedStairs, setLineHeight, setOpacity, setStairs, setTransparency
 
Methods inherited from class com.steema.teechart.styles.CustomPoint
addSeriesMouseListener, assign, calcXPos, calcYPos, calcZOrder, clickedPointer, drawMark, drawPointer, getMaxXValue, getMinXValue, getOriginPos, getPointer, getStacked, onGetPointerStyle, removePointerStyleResolver, removeSeriesMouseListener, sameClassOrigin, setPointerStyleResolver, setStacked
 
Methods inherited from class com.steema.teechart.styles.Series
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addChartValue, added, addedValue, addNull, addNullXY, addSeriesPaintListener, addValues, assignDispose, assignValues, associatedToAxis, beginUpdate, calcFirstLastVisibleIndex, calcPosValue, CalculateMarkPosition, calcXPosValue, calcXSizeValue, calcYPosValue, calcYSizeValue, canAddRandomPoints, changeType, checkDataSource, checkMouse, checkOrder, checkOtherSeries, clear, clearLists, clone, cloneSeries, convertArray, createNewSeries, createNewSeries, dataSourceArray, delete, delete, delete, dispose, doAfterDrawValues, doBeforeDrawChart, doBeforeDrawValues, doClick, doClickPointer, doDoubleClick, drawLegend, drawLegend, drawMarks, drawMarksSeries, drawSeries, drawSeriesForward, drawValuesForward, endUpdate, fillSampleValues, fillSampleValues, fireSeriesMouseEvent, fireSeriesPaint, firstDisplayed, galleryChanged3D, getActive, getAllowSinglePoint, getBitmapEditor, getColor, getColorEach, getColorMember, getColors, getCount, getCountLegendItems, getCursor, getCustomHorizAxis, getCustomVertAxis, getDataSource, getDefaultColor, getDefaultNullValue, getDepth, getEndZ, getFields, getFirstVisible, getFunction, getHasZValues, getHorizAxis, getHorizontalAxis, getLabelMember, getLabels, getLastVisible, getLegendString, getMandatory, getMandatoryAxis, getMarks, getMarkText, getMarkValue, getMaxZValue, getMiddleZ, getMinZValue, getNotMandatory, getNumGallerySeries, getNumSampleValues, getOriginValue, getPercentFormat, getPoint, getSeriesColor, getShowInLegend, getStartZ, getTitle, getUseAxis, getValueColor, getValueFormat, getValueIndexSwapper, getValueList, getValueList, getValueMarkText, getValuesLists, getVertAxis, getVerticalAxis, getVisible, getXValues, getYMandatory, getYValueList, getYValues, getZOrder, hasClickEvents, hasDataSource, hasListenersOf, hasNoMandatoryValues, isNull, isValidSeriesSource, isValidSourceOf, lastDisplayed, legendItemColor, legendToValueIndex, maxMarkWidth, moreSameZOrder, mouseEvent, newFromType, onDisposing, paintLegend, prepareLegendCanvas, randomBounds, recalcGetAxis, refreshSeries, removeMarkTextResolver, removeSeriesPaintListener, repaint, sameClass, setActive, setColorEach, setColorMember, setColors, setCursor, setCustomHorizAxis, setCustomHorizAxis, setCustomVertAxis, setCustomVertAxis, setDataSource, setDefaultNullValue, setDepth, setEndZ, setFunction, setHorizontal, setHorizontalAxis, setLabelMember, setLabels, setMarks, setMarkTextResolver, setMiddleZ, setNull, setNull, setPercentFormat, setSeriesColor, setShowInLegend, setStartZ, setTitle, setValueFormat, setValueList, setVerticalAxis, setVisible, setXValues, setYValues, setZOrder, setZPositions, sortByLabels, sortByLabels, swapValueIndex, titleOrName, toString, valuesListAdd, xScreenToValue, yScreenToValue
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setColorProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.steema.teechart.styles.ISeries
getChart, invalidate
 

Field Detail

linePen

protected ChartPen linePen

treatnulls

protected TreatNullsStyle treatnulls
Constructor Detail

Candle

public Candle(IBaseChart c)

Candle

public Candle()
Method Detail

getStyle

public CandleStyle getStyle()
Determines how the Candle points will be drawn.
When it is CandleStick, a vertical rectangle represents each candle point.
When it is CandleBar, a vertical line is drawn, among Open and Close horizontal tick marks.
You can control both the candle colors and width.
Default value: CandleStick

Returns:
CandleStyle

setStyle

public void setStyle(CandleStyle value)
Determines how the Candle points will be drawn.
Default value: CandleStick

Example:


 candleSeries = new com.steema.teechart.styles.Candle(myChart.getChart());
 candleSeries.fillSampleValues(30);

 candleSeries.setStyle(CandleStyles.OpenClose);
 

Parameters:
value - CandleStyles

createSubGallery

public void createSubGallery(Gallery addSubChart)
Overrides:
createSubGallery in class Series

setSubGallery

public void setSubGallery(int index)
Description copied from class: Series
Creates and prepares the index'th Series style to show at sub-gallery dialog.

Specified by:
setSubGallery in interface ISeries
Overrides:
setSubGallery in class Series
Parameters:
index - int

getCandleWidth

public int getCandleWidth()
The horizontal Candle Size in pixels.
It is based on pixels for Screen charts. When printing, this number is multiplied by the ratio between the Printer width and the Screen width.
Default value: 6

Returns:
int

setCandleWidth

public void setCandleWidth(int value)
Sets the horizontal Candle Size in pixels.
Default value: 6

Parameters:
value - int

getUpCloseColor

public Color getUpCloseColor()
Candle color fill when Open value is greater than Close value.
By default, UpCloseColor is WHITE and DownCloseColor is RED.
Each Candle will be filled with a different color depending on its Open and Close values.
If Open value is greater than Close value, then the selected color will be the UpCloseColor color.
If Close value is greater or equal than Open value, then the selected color will be the DownCloseColor color.
Default value: white

Returns:
Color

setUpCloseColor

public void setUpCloseColor(Color value)
Candle color fill when Open value is greater than Close value.
Default value: white

Parameters:
value - Color

getDownCloseColor

public Color getDownCloseColor()
Candle color fill when Close value is greater than Open value.
By default, UpCloseColor is WHITE and DownCloseColor is RED.
Each Candle will be filled with a different color depending on its Open and Close values.
If Open value is greater than Close value, then the selected color will be the UpCloseColor color.
If Close value is greater or equal than Open value, then the selected color will be the DownCloseColor color.
Default value: red

Returns:
Color

setDownCloseColor

public void setDownCloseColor(Color value)
Candle color fill when Close value is greater than Open value.
Default value: red

Parameters:
value - Color

getShowOpen

public boolean getShowOpen()
Determines whether Open prices will be displayed.
It only has effect when Candle series.CandleStyle is set to csCandleBar. CandleWidth determines the length in pixels of Open and Close ticks.
Default value: true

Returns:
boolean

setShowOpen

public void setShowOpen(boolean value)
Determines whether Open prices will be displayed.
Default value: true

Parameters:
value - boolean

getShowClose

public boolean getShowClose()
Determines whether Close prices will be displayed.
It only has effect when Candle series.CandleStyle is set to csCandleBar. CandleWidth determines the length in pixels of Open and Close ticks.
Default value: true

Returns:
boolean

setShowClose

public void setShowClose(boolean value)
Determines whether Close prices will be displayed.
Default value: true

Parameters:
value - boolean

drawValue

public void drawValue(int valueIndex)
Called internally. Draws the "ValueIndex" point of the Series.

Specified by:
drawValue in interface ISeries
Overrides:
drawValue in class Custom
Parameters:
valueIndex - int

getPen

public ChartPen getPen()

getMinYValue

public double getMinYValue()
Description copied from class: OHLC
The Minimum Value of the Series Y Values List.
As some Series have more than one Y Values List, this Minimum Value is the "Minimum of Minimums" of all Series Y Values lists.

Overrides:
getMinYValue in class OHLC
Returns:
double

getMaxYValue

public double getMaxYValue()
Description copied from class: OHLC
The Maximum Value of the Series Y Values List.

Overrides:
getMaxYValue in class OHLC
Returns:
double

prepareForGallery

public void prepareForGallery(boolean isEnabled)
Overrides:
prepareForGallery in class Series

getDescription

public java.lang.String getDescription()
Gets descriptive text.

Overrides:
getDescription in class Series
Returns:
String

clicked

public int clicked(int x,
                   int y)
Description copied from class: Custom
Calculates if any point is at XY position.

Specified by:
clicked in interface ISeries
Overrides:
clicked in class Custom
Parameters:
x - int
y - int
Returns:
int Point index

clicked

public int clicked(java.awt.Point p)
Overrides:
clicked in class Series

clickedCandle

public boolean clickedCandle(int valueIndex,
                             java.awt.Point p)

getLinePen

public ChartPen getLinePen()
Determines pen to draw the line connecting all points.

Returns:
ChartPen

getTreatNulls

public TreatNullsStyle getTreatNulls()
Defines how null points are treated.

Returns:
TreatNullsStyle

setTreatNulls

public void setTreatNulls(TreatNullsStyle value)