Class BubbleChart
-
Field Summary
Fields inherited from class Chart
annotations, axisPair, chartTitle, legend, plot, seriesMap, styler -
Constructor Summary
ConstructorsConstructorDescriptionBubbleChart(int width, int height) Constructor - the default Chart Theme will be used (XChartTheme)BubbleChart(int width, int height, Styler.ChartTheme chartTheme) ConstructorBubbleChart(int width, int height, Theme theme) ConstructorBubbleChart(BubbleChartBuilder chartBuilder) Constructor -
Method Summary
Modifier and TypeMethodDescriptionAdd a series for a Bubble type chart using using ListsaddSeries(String seriesName, List<? extends Number> xData, List<? extends Number> yData, List<? extends Number> bubbleData) Add a series for a Bubble type chart using using double arraysvoidpaint(Graphics2D g, int width, int height) private voidsanityCheck(String seriesName, double[] xData, double[] yData, double[] bubbleData) ////////////////////////////////////////////////private voidset the series color based on themeupdateBubbleSeries(String seriesName, double[] newXData, double[] newYData, double[] newBubbleData) Update a series by updating the X-Axis, Y-Axis and bubble dataupdateBubbleSeries(String seriesName, List<?> newXData, List<? extends Number> newYData, List<? extends Number> newBubbleData) Update a series by updating the X-Axis, Y-Axis and bubble 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
-
BubbleChart
public BubbleChart(int width, int height) Constructor - the default Chart Theme will be used (XChartTheme)- Parameters:
width-height-
-
BubbleChart
Constructor- Parameters:
width-height-theme- - pass in a instance of Theme class, probably a custom Theme.
-
BubbleChart
Constructor- Parameters:
width-height-chartTheme- - pass in the desired ChartTheme enum
-
BubbleChart
-
-
Method Details
-
addSeries
public BubbleSeries addSeries(String seriesName, List<? extends Number> xData, List<? extends Number> yData, List<? extends Number> bubbleData) Add a series for a Bubble type chart using using double arrays- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis databubbleData- the bubble data- Returns:
- A Series object that you can set properties on
-
addSeries
public BubbleSeries addSeries(String seriesName, double[] xData, double[] yData, double[] bubbleData) Add a series for a Bubble type chart using using Lists- Parameters:
seriesName-xData- the X-Axis datayData- the Y-Axis databubbleData- the bubble data- Returns:
-
updateBubbleSeries
public BubbleSeries updateBubbleSeries(String seriesName, List<?> newXData, List<? extends Number> newYData, List<? extends Number> newBubbleData) Update a series by updating the X-Axis, Y-Axis and bubble 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-newBubbleData- - set null if there are no error bars- Returns:
-
updateBubbleSeries
public BubbleSeries updateBubbleSeries(String seriesName, double[] newXData, double[] newYData, double[] newBubbleData) Update a series by updating the X-Axis, Y-Axis and bubble 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-newBubbleData- - set null if there are no error bars- Returns:
-
sanityCheck
//////////////////////////////////////////////// -
paint
- Specified by:
paintin classChart<BubbleStyler, BubbleSeries>
-
setSeriesStyles
private void setSeriesStyles()set the series color based on theme
-