Package org.jCharts.chartData
Class StockChartDataSet
java.lang.Object
org.jCharts.chartData.StockChartDataSet
- All Implemented Interfaces:
Serializable
,IAxisPlotDataSet
,IData
,IDataSet
,IStockChartDataSet
,HTMLTestable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChartType
private double[]
private double[]
private String[]
private double[]
private int
private double[]
private Paint[]
private StockChartProperties
-
Constructor Summary
ConstructorsConstructorDescriptionStockChartDataSet
(double[] high, String highLegendLabel, double[] low, String lowLegendLabel, Paint highLowPaint, StockChartProperties stockChartProperties) Constructor -
Method Summary
Modifier and TypeMethodDescriptionReturns the type constant that this data set should be plotted as.Returns the chart specific propertiesdouble
getCloseValue
(int index) double
getHighValue
(int index) getLegendLabel
(int index) Returns the legend label for the passed index.double
getLowValue
(int index) int
Returns the number of elements in the data set.int
Returns the number of IAxisChartDataSet Objects in this seriesint
Returns the number of Legend Labels to display.double
getOpenValue
(int index) getPaint
(int index) Returns the number of IAxisChartDataSet Objects in this seriesboolean
boolean
void
setCloseValues
(double[] data, String legendLabel, Paint paint) Sets the 'Close' valuesvoid
setOpenValues
(double[] data, String legendLabel, Paint paint) Sets the 'Open' valuesvoid
toHTML
(HTMLGenerator htmlGenerator) Enables the testing routines to display the contents of this Object.void
validate()
Performs a limited validation of data passed to Constructor.
-
Field Details
-
chartType
-
high
private double[] high -
low
private double[] low -
open
private double[] open -
close
private double[] close -
numberOfDataSets
private int numberOfDataSets -
legendLabels
-
paints
-
stockChartProperties
-
-
Constructor Details
-
StockChartDataSet
public StockChartDataSet(double[] high, String highLegendLabel, double[] low, String lowLegendLabel, Paint highLowPaint, StockChartProperties stockChartProperties) throws ChartDataException Constructor- 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 Details
-
validate
Performs a limited validation of data passed to Constructor.- Specified by:
validate
in interfaceIAxisPlotDataSet
- Throws:
ChartDataException
PropertyException
-
getLegendLabel
Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.- Specified by:
getLegendLabel
in interfaceIDataSet
- Parameters:
index
-- Returns:
- String
-
getNumberOfLegendLabels
public int getNumberOfLegendLabels()Returns the number of Legend Labels to display.- Specified by:
getNumberOfLegendLabels
in 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:
getNumberOfDataItems
in interfaceIDataSet
- Returns:
- int
-
setCloseValues
Sets the 'Close' values- Parameters:
data
-legendLabel
-paint
-
-
setOpenValues
Sets the 'Open' values- Parameters:
data
-legendLabel
-paint
-
-
getHighValue
public double getHighValue(int index) - Specified by:
getHighValue
in interfaceIStockChartDataSet
- Parameters:
index
-- Returns:
- double
-
getLowValue
public double getLowValue(int index) - Specified by:
getLowValue
in interfaceIStockChartDataSet
- Parameters:
index
-- Returns:
- double
-
getCloseValue
public double getCloseValue(int index) - Specified by:
getCloseValue
in interfaceIStockChartDataSet
- Parameters:
index
-- Returns:
- double
-
hasCloseValues
public boolean hasCloseValues()- Specified by:
hasCloseValues
in interfaceIStockChartDataSet
- Returns:
- boolean
-
getOpenValue
public double getOpenValue(int index) - Specified by:
getOpenValue
in interfaceIStockChartDataSet
- Parameters:
index
-- Returns:
- double
-
hasOpenValues
public boolean hasOpenValues()- Specified by:
hasOpenValues
in interfaceIStockChartDataSet
- Returns:
- boolean
-
getChartType
Returns the type constant that this data set should be plotted as.- Specified by:
getChartType
in interfaceIAxisPlotDataSet
- Specified by:
getChartType
in interfaceIStockChartDataSet
- Returns:
- ChartType
- See Also:
-
getChartTypeProperties
Returns the chart specific properties- Specified by:
getChartTypeProperties
in interfaceIDataSet
- Returns:
- ChartTypeProperties
-
getNumberOfDataSets
public int getNumberOfDataSets()Returns the number of IAxisChartDataSet Objects in this series- Specified by:
getNumberOfDataSets
in interfaceIAxisPlotDataSet
- Returns:
- int
-
getPaint
Returns the number of IAxisChartDataSet Objects in this series -
toHTML
Enables the testing routines to display the contents of this Object.- Specified by:
toHTML
in interfaceHTMLTestable
- Parameters:
htmlGenerator
-
-