Package org.knowm.xchart
Class OHLCChart
- java.lang.Object
-
- org.knowm.xchart.internal.chartpart.Chart<OHLCStyler,OHLCSeries>
-
- org.knowm.xchart.OHLCChart
-
public class OHLCChart extends org.knowm.xchart.internal.chartpart.Chart<OHLCStyler,OHLCSeries>
- Author:
- arthurmcgibbon
-
-
Constructor Summary
Constructors Constructor Description OHLCChart(int width, int height)
Constructor - the default Chart Theme will be used (XChartTheme)OHLCChart(int width, int height, Styler.ChartTheme chartTheme)
ConstructorOHLCChart(int width, int height, Theme theme)
ConstructorOHLCChart(OHLCChartBuilder chartBuilder)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OHLCSeries
addSeries(String seriesName, double[] openData, double[] highData, double[] lowData, double[] closeData)
Add a series for a OHLC type chart using using double arraysOHLCSeries
addSeries(String seriesName, double[] xData, double[] openData, double[] highData, double[] lowData, double[] closeData)
OHLCSeries
addSeries(String seriesName, float[] openData, float[] highData, float[] lowData, float[] closeData)
Add a series for a OHLC type chart using using float arraysOHLCSeries
addSeries(String seriesName, float[] xData, float[] openData, float[] highData, float[] lowData, float[] closeData)
Add a series for a OHLC type chart using using float arraysOHLCSeries
addSeries(String seriesName, int[] openData, int[] highData, int[] lowData, int[] closeData)
Add a series for a OHLC type chart using using int arraysOHLCSeries
addSeries(String seriesName, int[] xData, int[] openData, int[] highData, int[] lowData, int[] closeData)
Add a series for a OHLC type chart using using int arraysOHLCSeries
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 ListsOHLCSeries
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 Listsvoid
paint(Graphics2D g, int width, int height)
OHLCSeries
updateOHLCSeries(String seriesName, double[] newXData, double[] newOpenData, double[] newHighData, double[] newLowData, double[] newCloseData)
Update a series by updating the X-Axis and Y-AxisOHLCSeries
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 X-Axis and Y-Axis-
Methods inherited from class org.knowm.xchart.internal.chartpart.Chart
getHeight, getSeriesMap, getStyler, getTitle, getToolTips, getWidth, getXAxisTitle, getYAxisGroupTitle, getYAxisLabelOverrideMap, getYAxisTitle, paintBackground, removeSeries, setHeight, setTitle, setWidth, setXAxisLabelOverrideMap, setXAxisTitle, setYAxisGroupTitle, setYAxisLabelOverrideMap, setYAxisLabelOverrideMap, setYAxisTitle
-
-
-
-
Constructor Detail
-
OHLCChart
public OHLCChart(int width, int height)
Constructor - the default Chart Theme will be used (XChartTheme)- Parameters:
width
-height
-
-
OHLCChart
public OHLCChart(int width, int height, Theme theme)
Constructor- Parameters:
width
-height
-theme
- - pass in a instance of Theme class, probably a custom Theme.
-
OHLCChart
public OHLCChart(int width, int height, Styler.ChartTheme chartTheme)
Constructor- Parameters:
width
-height
-chartTheme
- - pass in the desired ChartTheme enum
-
OHLCChart
public OHLCChart(OHLCChartBuilder chartBuilder)
Constructor- Parameters:
chartBuilder
-
-
-
Method Detail
-
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, 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, 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<? 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
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
-
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 X-Axis and Y-Axis- 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)
Update a series by updating the X-Axis and Y-Axis- 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:
-
paint
public void paint(Graphics2D g, int width, int height)
- Specified by:
paint
in classorg.knowm.xchart.internal.chartpart.Chart<OHLCStyler,OHLCSeries>
-
-