Package org.jCharts.chartData
Class StockChartDataSet
- java.lang.Object
-
- org.jCharts.chartData.StockChartDataSet
-
- All Implemented Interfaces:
java.io.Serializable,IAxisPlotDataSet,IData,IDataSet,IStockChartDataSet,HTMLTestable
public class StockChartDataSet extends java.lang.Object implements IStockChartDataSet, HTMLTestable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private ChartTypechartTypeprivate double[]closeprivate double[]highprivate java.lang.String[]legendLabelsprivate double[]lowprivate intnumberOfDataSetsprivate double[]openprivate java.awt.Paint[]paintsprivate StockChartPropertiesstockChartProperties
-
Constructor Summary
Constructors Constructor Description StockChartDataSet(double[] high, java.lang.String highLegendLabel, double[] low, java.lang.String lowLegendLabel, java.awt.Paint highLowPaint, StockChartProperties stockChartProperties)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChartTypegetChartType()Returns the type constant that this data set should be plotted as.ChartTypePropertiesgetChartTypeProperties()Returns the chart specific propertiesdoublegetCloseValue(int index)doublegetHighValue(int index)java.lang.StringgetLegendLabel(int index)Returns the legend label for the passed index.doublegetLowValue(int index)intgetNumberOfDataItems()Returns the number of elements in the data set.intgetNumberOfDataSets()Returns the number of IAxisChartDataSet Objects in this seriesintgetNumberOfLegendLabels()Returns the number of Legend Labels to display.doublegetOpenValue(int index)java.awt.PaintgetPaint(int index)Returns the number of IAxisChartDataSet Objects in this seriesbooleanhasCloseValues()booleanhasOpenValues()voidsetCloseValues(double[] data, java.lang.String legendLabel, java.awt.Paint paint)Sets the 'Close' valuesvoidsetOpenValues(double[] data, java.lang.String legendLabel, java.awt.Paint paint)Sets the 'Open' valuesvoidtoHTML(HTMLGenerator htmlGenerator)Enables the testing routines to display the contents of this Object.voidvalidate()Performs a limited validation of data passed to Constructor.
-
-
-
Field Detail
-
chartType
private ChartType chartType
-
high
private double[] high
-
low
private double[] low
-
open
private double[] open
-
close
private double[] close
-
numberOfDataSets
private int numberOfDataSets
-
legendLabels
private java.lang.String[] legendLabels
-
paints
private java.awt.Paint[] paints
-
stockChartProperties
private StockChartProperties stockChartProperties
-
-
Constructor Detail
-
StockChartDataSet
public StockChartDataSet(double[] high, java.lang.String highLegendLabel, double[] low, java.lang.String lowLegendLabel, java.awt.Paint highLowPaint, StockChartProperties stockChartProperties) throws ChartDataExceptionConstructor- Parameters:
high-highLegendLabel-low-lowLegendLabel-stockChartProperties- properties Object specific to the type of chart you are rendering.- Throws:
ChartDataException- performs a limited validation of the data
-
-
Method Detail
-
validate
public void validate() throws ChartDataException, PropertyExceptionPerforms a limited validation of data passed to Constructor.- Specified by:
validatein interfaceIAxisPlotDataSet- Throws:
ChartDataExceptionPropertyException
-
getLegendLabel
public java.lang.String getLegendLabel(int index)
Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.- Specified by:
getLegendLabelin interfaceIDataSet- Parameters:
index-- Returns:
- String
-
getNumberOfLegendLabels
public int getNumberOfLegendLabels()
Returns the number of Legend Labels to display.- Specified by:
getNumberOfLegendLabelsin interfaceIDataSet- Returns:
- int
-
getNumberOfDataItems
public int getNumberOfDataItems()
Returns the number of elements in the data set. All data sets must be of the same length so just look at the first one.- Specified by:
getNumberOfDataItemsin interfaceIDataSet- Returns:
- int
-
setCloseValues
public void setCloseValues(double[] data, java.lang.String legendLabel, java.awt.Paint paint)Sets the 'Close' values- Parameters:
data-legendLabel-paint-
-
setOpenValues
public void setOpenValues(double[] data, java.lang.String legendLabel, java.awt.Paint paint)Sets the 'Open' values- Parameters:
data-legendLabel-paint-
-
getHighValue
public double getHighValue(int index)
- Specified by:
getHighValuein interfaceIStockChartDataSet- Parameters:
index-- Returns:
- double
-
getLowValue
public double getLowValue(int index)
- Specified by:
getLowValuein interfaceIStockChartDataSet- Parameters:
index-- Returns:
- double
-
getCloseValue
public double getCloseValue(int index)
- Specified by:
getCloseValuein interfaceIStockChartDataSet- Parameters:
index-- Returns:
- double
-
hasCloseValues
public boolean hasCloseValues()
- Specified by:
hasCloseValuesin interfaceIStockChartDataSet- Returns:
- boolean
-
getOpenValue
public double getOpenValue(int index)
- Specified by:
getOpenValuein interfaceIStockChartDataSet- Parameters:
index-- Returns:
- double
-
hasOpenValues
public boolean hasOpenValues()
- Specified by:
hasOpenValuesin interfaceIStockChartDataSet- Returns:
- boolean
-
getChartType
public ChartType getChartType()
Returns the type constant that this data set should be plotted as.- Specified by:
getChartTypein interfaceIAxisPlotDataSet- Specified by:
getChartTypein interfaceIStockChartDataSet- Returns:
- ChartType
- See Also:
ChartType
-
getChartTypeProperties
public ChartTypeProperties getChartTypeProperties()
Returns the chart specific properties- Specified by:
getChartTypePropertiesin interfaceIDataSet- Returns:
- ChartTypeProperties
-
getNumberOfDataSets
public int getNumberOfDataSets()
Returns the number of IAxisChartDataSet Objects in this series- Specified by:
getNumberOfDataSetsin interfaceIAxisPlotDataSet- Returns:
- int
-
getPaint
public java.awt.Paint getPaint(int index)
Returns the number of IAxisChartDataSet Objects in this series
-
toHTML
public void toHTML(HTMLGenerator htmlGenerator)
Enables the testing routines to display the contents of this Object.- Specified by:
toHTMLin interfaceHTMLTestable- Parameters:
htmlGenerator-
-
-