Class XYChart
-
Field Summary
Fields inherited from class Chart
annotations, axisPair, chartTitle, legend, plot, seriesMap, styler -
Constructor Summary
ConstructorsConstructorDescriptionXYChart(int width, int height) Constructor - the default Chart Theme will be used (XChartTheme)XYChart(int width, int height, Styler.ChartTheme chartTheme) ConstructorConstructorXYChart(XYChartBuilder chartBuilder) Constructor -
Method Summary
Modifier and TypeMethodDescriptionAdd a series for a X-Y type chart using using double arraysAdd a series for a X-Y type chart using using double arraysprivate XYSeriesaddSeries(String seriesName, double[] xData, double[] yData, double[] errorBars, Series.DataType dataType) Add a series for a X-Y type chart using Lists with error barsAdd a series for a X-Y type chart using using float arraysAdd a series for a X-Y type chart using using float arraysAdd a series for a X-Y type chart using using float arrays with error barsAdd a series for a X-Y type chart using using int arraysAdd a series for a X-Y type chart using using int arraysAdd a series for a X-Y type chart using using int arrays with error barsAdd a series for a X-Y type chart using ListsaddSeries(String seriesName, List<?> xData, List<? extends Number> yData, List<? extends Number> errorBars) Add a series for a X-Y type chart using ListsAdd a series for a X-Y type chart using Listsprivate Series.DataTypegetDataType(List<?> data) voidpaint(Graphics2D g, int width, int height) private voidsanityCheck(String seriesName, double[] xData, double[] yData, double[] errorBars) ////////////////////////////////////////////////private voidset the series color, marker and line style based on themeupdateXYSeries(String seriesName, double[] newXData, double[] newYData, double[] newErrorBarData) Update a series by updating the X-Axis, Y-Axis and error bar dataupdateXYSeries(String seriesName, List<?> newXData, List<? extends Number> newYData, List<? extends Number> newErrorBarData) Update a series by updating the X-Axis, Y-Axis and error bar dataMethods 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
-
XYChart
public XYChart(int width, int height) Constructor - the default Chart Theme will be used (XChartTheme)- Parameters:
width-height-
-
XYChart
Constructor- Parameters:
width-height-theme- - pass in an instance of Theme class, probably a custom Theme.
-
XYChart
Constructor- Parameters:
width-height-chartTheme- - pass in the desired ChartTheme enum
-
XYChart
-
-
Method Details
-
addSeries
-
addSeries
-
addSeries
-
addSeries
-
addSeries
Add a series for a X-Y type chart using using float arrays with error bars- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis dataerrorBars- the error bar data- Returns:
- A Series object that you can set properties on
-
addSeries
-
addSeries
-
addSeries
Add a series for a X-Y type chart using using int arrays with error bars- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis dataerrorBars- the error bar data- Returns:
- A Series object that you can set properties on
-
addSeries
-
addSeries
-
addSeries
public XYSeries addSeries(String seriesName, List<?> xData, List<? extends Number> yData, List<? extends Number> errorBars) Add a series for a X-Y type chart using Lists- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis dataerrorBars- the error bar data- Returns:
- A Series object that you can set properties on
-
getDataType
-
addSeries
-
addSeries
private XYSeries addSeries(String seriesName, double[] xData, double[] yData, double[] errorBars, Series.DataType dataType) Add a series for a X-Y type chart using Lists with error bars- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis dataerrorBars- the error bar data- Returns:
- A Series object that you can set properties on
-
updateXYSeries
public XYSeries updateXYSeries(String seriesName, List<?> newXData, List<? extends Number> newYData, List<? extends Number> newErrorBarData) Update a series by updating the X-Axis, Y-Axis and error bar data- 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.newYData-newErrorBarData- - set null if there are no error bars- Returns:
-
updateXYSeries
public XYSeries updateXYSeries(String seriesName, double[] newXData, double[] newYData, double[] newErrorBarData) Update a series by updating the X-Axis, Y-Axis and error bar data- 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.newYData-newErrorBarData- - set null if there are no error bars- Returns:
-
sanityCheck
//////////////////////////////////////////////// -
paint
-
setSeriesStyles
private void setSeriesStyles()set the series color, marker and line style based on theme
-