lt.monarch.chart.chart2D.series
Class StockSeries

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<Tags>
      extended by lt.monarch.chart.AbstractChartSeries<Tags,ChartProjector>
          extended by lt.monarch.chart.chart2D.series.MarkerDecorableSeries<StockSeriesPaintTags,Projector2D>
              extended by lt.monarch.chart.chart2D.series.StockSeries
All Implemented Interfaces:
java.io.Serializable, AbstractMarkerSeries, ChartEntity, ChartObject, ChartSeries, StyleEditorEntity

public class StockSeries
extends MarkerDecorableSeries<StockSeriesPaintTags,Projector2D>

Displays stock chart series. Series can be High-Low, High-Low-Close, Open-High-Low-Close and CandleStick.

Here is an example of real life stock market and using together BarSeries in the separate chart to represent the volume:

See Also:
Serialized Form

Nested Class Summary
Modifier and Type Class and Description
 
Nested classes/interfaces inherited from class lt.monarch.chart.chart2D.series.MarkerDecorableSeries
MarkerDecorableSeries.MarkerEntity
 
Field Summary
Modifier and Type Field and Description
protected  PlaneMapper mapper
          the plane mapper
 
Fields inherited from class lt.monarch.chart.chart2D.series.MarkerDecorableSeries
baseValue, colorMapper, markerPainter, markers, minMaxValues, pseudoModel
 
Fields inherited from class lt.monarch.chart.AbstractChartSeries
metaModel, modelValidator, seriesName, seriesTransform, showLegend, showNullValues, symbol, xMapper, yMapper, zMapper
 
Fields inherited from class lt.monarch.chart.engine.AbstractChartObject
AXIS_SORT_POSITION, BREAK_LINE_POSITION, DEFAULT_SORT_POSITION, GRID_SORT_POSITION, MARKER_SERIES_SORT_POSITION, MARKERS_SORT_POSITION, paintStyle, SERIES_SORT_POSITION, sortPosition, style
 
Constructor Summary
Constructor and Description
StockSeries(ArrayDataModel model, AxisMapper xMapper, AxisMapper yMapper)
          Line series constructor without a meta data model and default plane mapper is for Cartesian coordinates.
StockSeries(ArrayDataModel model, MetaDataModel metaModel, AxisMapper xMapper, AxisMapper yMapper)
          Constructs a new Line series.
StockSeries(ArrayDataModel model, PlaneMapper mapper, AxisMapper xMapper, AxisMapper yMapper)
          Line series constructor without a meta data model
StockSeries(DataModel model, MetaDataModel metaModel, PlaneMapper mapper, AxisMapper xMapper, AxisMapper yMapper)
          Constructs a new line series
 
Method Summary
Modifier and Type Method and Description
 LegendEntry[] createLegendEntries()
          Creates legend entries for the series.
 void draw(AbstractGraphics g)
          Renders chart object on the Graphics context.
 java.util.ArrayList<java.util.ArrayList<MarkerConstraints>> getMarkerConstraints()
           
 java.lang.Object getMaxValue(DataColumnType valType)
          Note: internal use only! Gets maximum value that is used by series to fit into the chart
 java.lang.Object getMinValue(DataColumnType valType)
          Note: internal use only! Gets minimum value that is used by series to fit into the chart
 boolean getShowNullValues()
          Returns true if this component shows (accounts for) null values.
 AbstractQuoteStrategy<Projector2D> getStrategy()
          Gets line drawing strategy.
protected  void initLegendSymbol()
          Initializes a new LineSeries legend symbol used for representing line series in legend.
 void setNames(java.lang.String StockRiseName, java.lang.String StockDownName)
          Sets chart series of stock rise and down names.
 void setStrategy(StockStrategies strategy)
          Sets line drawing strategy.
 
Methods inherited from class lt.monarch.chart.chart2D.series.MarkerDecorableSeries
addMarker, addMarker, addMarker, calculateNullValue, copy, dataConstraintExtraction, drawMarkers, drawMarkers, generateConstaint, getBaseValue, getColorMapper, getKeyType, getMarkers, getMarkerStyle, getPaintMode, getPointForConstraint, getSortPosition, layout, mapMinMaxValue, removeMarker, setBaseValue, setColorMapper, setPaintMode
 
Methods inherited from class lt.monarch.chart.AbstractChartSeries
activate, checkDataModelRequirements, createLegendEntry, createLegendSymbol, deactivate, fillEntitySheet, getChartObjectBounds, getDataModel, getDescription, getMetaDataModel, getModelValidator, getName, getNearestChildEntity, getParentEntity, getProjector, getSeriesColor, getShortDescription, getXMapper, getYMapper, getZMapper, handleDataModelChangeEvent, setLegendSymbol, setName, setShowNullValues, setValidateData, showLegend, updateClippingToProjector
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
chart, copy, dispose, finalize, getChart, getPaintStyle, getParent, getStyle, getStyle, invalidate, isVisible, repaint, repaint, setChart, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lt.monarch.chart.engine.ChartObject
dispose, getChart, getStyle, getStyle, invalidate, isVisible, repaint, repaint, setChart
 
Methods inherited from interface lt.monarch.chart.engine.StyleEditorEntity
getParent, getStyle
 

Field Detail

mapper

protected PlaneMapper mapper
the plane mapper

Constructor Detail

StockSeries

public StockSeries(DataModel model,
                   MetaDataModel metaModel,
                   PlaneMapper mapper,
                   AxisMapper xMapper,
                   AxisMapper yMapper)
Constructs a new line series

Parameters:
model - chart data model
metaModel - meta data model
mapper - mapper, used to map output to a plane in a n-dimensional space
xMapper - x axis mapper
yMapper - y axis mapper

StockSeries

public StockSeries(ArrayDataModel model,
                   PlaneMapper mapper,
                   AxisMapper xMapper,
                   AxisMapper yMapper)
Line series constructor without a meta data model

Parameters:
model - chart data model
mapper - mapper, used to map output to a plane in a n-dimensional space
xMapper - x axis mapper
yMapper - y axis mapper

StockSeries

public StockSeries(ArrayDataModel model,
                   AxisMapper xMapper,
                   AxisMapper yMapper)
Line series constructor without a meta data model and default plane mapper is for Cartesian coordinates.

Parameters:
model - chart data model
xMapper - x axis mapper
yMapper - y axis mapper

StockSeries

public StockSeries(ArrayDataModel model,
                   MetaDataModel metaModel,
                   AxisMapper xMapper,
                   AxisMapper yMapper)
Constructs a new Line series. The default plane mapper is used for Cartesian coordinate system.

Parameters:
model - chart data model
metaModel - meta data model
xMapper - x axis mapper
yMapper - y axis mapper
Method Detail

initLegendSymbol

protected void initLegendSymbol()
Initializes a new LineSeries legend symbol used for representing line series in legend.


draw

public void draw(AbstractGraphics g)
Description copied from interface: ChartObject
Renders chart object on the Graphics context.

Specified by:
draw in interface ChartObject
Overrides:
draw in class MarkerDecorableSeries<StockSeriesPaintTags,Projector2D>
Parameters:
g - graphics context

getMarkerConstraints

public java.util.ArrayList<java.util.ArrayList<MarkerConstraints>> getMarkerConstraints()
Overrides:
getMarkerConstraints in class MarkerDecorableSeries<StockSeriesPaintTags,Projector2D>

setStrategy

public void setStrategy(StockStrategies strategy)
Sets line drawing strategy. If you want to set your own custom strategy set it directly to the stylesheet, using tag "strategy", e.g. style.setObject("strategy", new MyStrategy());

Parameters:
strategy - drawing strategy

getStrategy

public AbstractQuoteStrategy<Projector2D> getStrategy()
Gets line drawing strategy.

Returns:
line drawing strategy

getShowNullValues

public boolean getShowNullValues()
Description copied from class: AbstractChartSeries
Returns true if this component shows (accounts for) null values. Null values are not actually displayed, but the space and position is calculated on the axis accordingly as if they of zero value.

Overrides:
getShowNullValues in class AbstractChartSeries<StockSeriesPaintTags,Projector2D>
Returns:
boolean true if null values are displayed and false if they are ignored (filtered).

getMaxValue

public java.lang.Object getMaxValue(DataColumnType valType)
Description copied from class: AbstractChartSeries
Note: internal use only! Gets maximum value that is used by series to fit into the chart

Overrides:
getMaxValue in class MarkerDecorableSeries<StockSeriesPaintTags,Projector2D>
Parameters:
valType - data value column
Returns:
maximum value needed

getMinValue

public java.lang.Object getMinValue(DataColumnType valType)
Description copied from class: AbstractChartSeries
Note: internal use only! Gets minimum value that is used by series to fit into the chart

Overrides:
getMinValue in class MarkerDecorableSeries<StockSeriesPaintTags,Projector2D>
Parameters:
valType - data value column
Returns:
minimum value needed

createLegendEntries

public LegendEntry[] createLegendEntries()
Description copied from class: AbstractChartSeries
Creates legend entries for the series.

Specified by:
createLegendEntries in interface ChartSeries
Overrides:
createLegendEntries in class AbstractChartSeries<StockSeriesPaintTags,Projector2D>
Returns:
legend entries

setNames

public void setNames(java.lang.String StockRiseName,
                     java.lang.String StockDownName)
Sets chart series of stock rise and down names.

Parameters:
StockRiseName - chart series of stock rise name
StockDownName - chart series of stock down name