Class OHLCChart
-
Field Summary
Fields inherited from class Chart
annotations, axisPair, chartTitle, legend, plot, seriesMap, styler -
Constructor Summary
ConstructorsConstructorDescriptionOHLCChart(int width, int height) Constructor - the default Chart Theme will be used (XChartTheme)OHLCChart(int width, int height, Styler.ChartTheme chartTheme) ConstructorConstructorOHLCChart(OHLCChartBuilder chartBuilder) Constructor -
Method Summary
Modifier and TypeMethodDescriptionAdd a series for a Line type chart using double arraysaddSeries(String seriesName, double[] openData, double[] highData, double[] lowData, double[] closeData) Add a series for a OHLC type chart using using double arraysaddSeries(String seriesName, double[] xData, double[] openData, double[] highData, double[] lowData, double[] closeData) addSeries(String seriesName, double[] xData, double[] openData, double[] highData, double[] lowData, double[] closeData, long[] volumeData) Add a series for a OHLC type chart using using double arraysprivate OHLCSeriesaddSeries(String seriesName, double[] xData, double[] openData, double[] highData, double[] lowData, double[] closeData, long[] volumeData, Series.DataType dataType) private OHLCSeriesaddSeries(String seriesName, double[] xData, double[] yData, Series.DataType dataType) Add a series for a Line type chart using float arraysaddSeries(String seriesName, float[] openData, float[] highData, float[] lowData, float[] closeData) Add a series for a OHLC type chart using using float arraysaddSeries(String seriesName, float[] xData, float[] openData, float[] highData, float[] lowData, float[] closeData) Add a series for a OHLC type chart using using float arraysaddSeries(String seriesName, float[] xData, float[] openData, float[] highData, float[] lowData, float[] closeData, float[] volumeData) Add a series for a OHLC type chart using using float arraysAdd a series for a Line type chart using int arraysAdd a series for a OHLC type chart using using int arraysaddSeries(String seriesName, int[] xData, int[] openData, int[] highData, int[] lowData, int[] closeData) Add a series for a OHLC type chart using using int arraysaddSeries(String seriesName, int[] xData, int[] openData, int[] highData, int[] lowData, int[] closeData, int[] volumeData) Add a series for a OHLC type chart using using int arraysAdd a series for a Line type chart using ListsaddSeries(String seriesName, List<?> xData, List<? extends Number> openData, List<? extends Number> highData, List<? extends Number> lowData, List<? extends Number> closeData) Add a series for a OHLC type chart using ListsaddSeries(String seriesName, List<?> xData, List<? extends Number> openData, List<? extends Number> highData, List<? extends Number> lowData, List<? extends Number> closeData, List<? extends Number> volumeData) Add a series for a OHLC type chart using ListsaddSeries(String seriesName, List<? extends Number> openData, List<? extends Number> highData, List<? extends Number> lowData, List<? extends Number> closeData) Add a series for a OHLC type chart using Listsprivate voidprivate voidcheckDataLengths(String seriesName, String data1Name, String data2Name, double[] data1, double[] data2) private Series.DataTypegetDataType(List<?> data) voidpaint(Graphics2D g, int width, int height) private voidsanityCheck(String seriesName, double[] openData, double[] highData, double[] lowData, double[] closeData, long[] volumeData) ////////////////////////////////////////////////private voidset the series color, marker and line style based on themeupdateOHLCSeries(String seriesName, double[] newXData, double[] newYData) Update a series by updating the X-Axis and Y-Axis dataupdateOHLCSeries(String seriesName, double[] newXData, double[] newOpenData, double[] newHighData, double[] newLowData, double[] newCloseData) Update a series by updating the xData, openData, highData, lowData and closeDataupdateOHLCSeries(String seriesName, double[] newXData, double[] newOpenData, double[] newHighData, double[] newLowData, double[] newCloseData, long[] newVolumeData) Update a series by updating the xData, openData, highData, lowData,closeData and volumeDataupdateOHLCSeries(String seriesName, List<?> newXData, List<? extends Number> newYData) Update a series by updating the X-Axis and Y-Axis dataupdateOHLCSeries(String seriesName, List<?> newXData, List<? extends Number> newOpenData, List<? extends Number> newHighData, List<? extends Number> newLowData, List<? extends Number> newCloseData) Update a series by updating the xData, openData, highData, lowData and closeDataupdateOHLCSeries(String seriesName, List<?> newXData, List<? extends Number> newOpenData, List<? extends Number> newHighData, List<? extends Number> newLowData, List<? extends Number> newCloseData, List<? extends Number> volumeData) Methods inherited from class Chart
addAnnotation, getChartXFromCoordinate, getChartYFromCoordinate, getChartYFromCoordinate, getHeight, getScreenXFromChart, getScreenYFromChart, getScreenYFromChart, getSeriesMap, getStyler, getTitle, getWidth, getXAxisTitle, getYAxisGroupTitle, getYAxisLeftWidth, getYAxisTitle, paintBackground, removeSeries, setCustomXAxisTickLabelsFormatter, setCustomYAxisTickLabelsFormatter, setHeight, setTitle, setWidth, setXAxisTitle, setYAxisGroupTitle, setYAxisTitle
-
Constructor Details
-
OHLCChart
public OHLCChart(int width, int height) Constructor - the default Chart Theme will be used (XChartTheme)- Parameters:
width-height-
-
OHLCChart
Constructor- Parameters:
width-height-theme- - pass in a instance of Theme class, probably a custom Theme.
-
OHLCChart
Constructor- Parameters:
width-height-chartTheme- - pass in the desired ChartTheme enum
-
OHLCChart
-
-
Method Details
-
addSeries
public OHLCSeries addSeries(String seriesName, float[] openData, float[] highData, float[] lowData, float[] closeData) Add a series for a OHLC type chart using using float arrays- Parameters:
seriesName-openData- the open datahighData- the high datalowData- the low datacloseData- the close data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, float[] xData, float[] openData, float[] highData, float[] lowData, float[] closeData) Add a series for a OHLC type chart using using float arrays- Parameters:
seriesName-xData- the x-axis dataopenData- the open datahighData- the high datalowData- the low datacloseData- the close data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, float[] xData, float[] openData, float[] highData, float[] lowData, float[] closeData, float[] volumeData) Add a series for a OHLC type chart using using float arrays- Parameters:
seriesName-xData- the x-axis dataopenData- the open datahighData- the high datalowData- the low datacloseData- the close datavolumeData- the volume data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, int[] openData, int[] highData, int[] lowData, int[] closeData) Add a series for a OHLC type chart using using int arrays- Parameters:
seriesName-openData- the open datahighData- the high datalowData- the low datacloseData- the close data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, int[] xData, int[] openData, int[] highData, int[] lowData, int[] closeData) Add a series for a OHLC type chart using using int arrays- Parameters:
seriesName-xData- the x-axis dataopenData- the open datahighData- the high datalowData- the low datacloseData- the close data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, int[] xData, int[] openData, int[] highData, int[] lowData, int[] closeData, int[] volumeData) Add a series for a OHLC type chart using using int arrays- Parameters:
seriesName-xData- the x-axis dataopenData- the open datahighData- the high datalowData- the low datacloseData- the close datavolumeData- the volume data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, List<?> xData, List<? extends Number> openData, List<? extends Number> highData, List<? extends Number> lowData, List<? extends Number> closeData) Add a series for a OHLC type chart using Lists- Parameters:
seriesName-xData- the x-axis dataopenData- the open datahighData- the high datalowData- the low datacloseData- the close data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, List<?> xData, List<? extends Number> openData, List<? extends Number> highData, List<? extends Number> lowData, List<? extends Number> closeData, List<? extends Number> volumeData) Add a series for a OHLC type chart using Lists- Parameters:
seriesName-xData- the x-axis dataopenData- the open datahighData- the high datalowData- the low datacloseData- the close datavolumeData- the volume data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, List<? extends Number> openData, List<? extends Number> highData, List<? extends Number> lowData, List<? extends Number> closeData) Add a series for a OHLC type chart using Lists- Parameters:
seriesName-openData- the open datahighData- the high datalowData- the low datacloseData- the close data- Returns:
- A Series object that you can set properties on
-
addSeries
Add a series for a Line type chart using int arrays- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis data- Returns:
- A Series object that you can set properties on
-
addSeries
Add a series for a Line type chart using float arrays- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis data- Returns:
- A Series object that you can set properties on
-
addSeries
Add a series for a Line type chart using double arrays- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis data- Returns:
- A Series object that you can set properties on
-
addSeries
Add a series for a Line type chart using Lists- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis data- Returns:
- A Series object that you can set properties on
-
getDataType
-
addSeries
public OHLCSeries addSeries(String seriesName, double[] xData, double[] openData, double[] highData, double[] lowData, double[] closeData) -
addSeries
public OHLCSeries addSeries(String seriesName, double[] openData, double[] highData, double[] lowData, double[] closeData) Add a series for a OHLC type chart using using double arrays- Parameters:
seriesName-openData- the open datahighData- the high datalowData- the low datacloseData- the close data- Returns:
- A Series object that you can set properties on
-
addSeries
public OHLCSeries addSeries(String seriesName, double[] xData, double[] openData, double[] highData, double[] lowData, double[] closeData, long[] volumeData) Add a series for a OHLC type chart using using double arrays- Parameters:
seriesName-xData- the x-axis dataopenData- the open datahighData- the high datalowData- the low datacloseData- the close datavolumeData- the volume data- Returns:
- A Series object that you can set properties on
-
addSeries
private OHLCSeries addSeries(String seriesName, double[] xData, double[] openData, double[] highData, double[] lowData, double[] closeData, long[] volumeData, Series.DataType dataType) -
addSeries
private OHLCSeries addSeries(String seriesName, double[] xData, double[] yData, Series.DataType dataType) -
updateOHLCSeries
public OHLCSeries updateOHLCSeries(String seriesName, List<?> newXData, List<? extends Number> newOpenData, List<? extends Number> newHighData, List<? extends Number> newLowData, List<? extends Number> newCloseData) Update a series by updating the xData, openData, highData, lowData and closeData- Parameters:
seriesName-newXData- - set null to be automatically generated as a list of increasing Integers starting from 1 and ending at the size of the new Y-Axis data list.newOpenData-newHighData-newLowData-newCloseData-- Returns:
-
updateOHLCSeries
-
updateOHLCSeries
public OHLCSeries updateOHLCSeries(String seriesName, double[] newXData, double[] newOpenData, double[] newHighData, double[] newLowData, double[] newCloseData) Update a series by updating the xData, openData, highData, lowData and closeData- Parameters:
seriesName-newXData- - set null to be automatically generated as a list of increasing Integers starting from 1 and ending at the size of the new Y-Axis data list.newOpenData-newHighData-newLowData-newCloseData-- Returns:
-
updateOHLCSeries
public OHLCSeries updateOHLCSeries(String seriesName, double[] newXData, double[] newOpenData, double[] newHighData, double[] newLowData, double[] newCloseData, long[] newVolumeData) Update a series by updating the xData, openData, highData, lowData,closeData and volumeData- Parameters:
seriesName-newXData- - set null to be automatically generated as a list of increasing Integers starting from 1 and ending at the size of the new Y-Axis data list.newOpenData-newHighData-newLowData-newCloseData-newVolumeData-- Returns:
-
updateOHLCSeries
public OHLCSeries updateOHLCSeries(String seriesName, List<?> newXData, List<? extends Number> newYData) Update a series by updating the X-Axis and Y-Axis data- Parameters:
seriesName-newXData-newYData-- Returns:
-
updateOHLCSeries
Update a series by updating the X-Axis and Y-Axis data- Parameters:
seriesName-newXData-newYData-- Returns:
-
checkData
-
checkDataLengths
-
sanityCheck
private void sanityCheck(String seriesName, double[] openData, double[] highData, double[] lowData, double[] closeData, long[] volumeData) //////////////////////////////////////////////// -
paint
- Specified by:
paintin classChart<OHLCStyler, OHLCSeries>
-
setSeriesStyles
private void setSeriesStyles()set the series color, marker and line style based on theme
-