Package org.knowm.xchart
Class PieChart
-
Field Summary
Fields inherited from class org.knowm.xchart.internal.chartpart.Chart
annotations, axisPair, chartTitle, legend, plot, seriesMap, styler -
Constructor Summary
ConstructorsConstructorDescriptionPieChart(int width, int height) Constructor - the default Chart Theme will be used (XChartTheme)PieChart(int width, int height, Styler.ChartTheme chartTheme) ConstructorConstructorPieChart(PieChartBuilder chartBuilder) Constructor -
Method Summary
Modifier and TypeMethodDescriptionAdd a series for a Pie type chartvoidpaint(Graphics2D g, int width, int height) private voidset the series color based on themeupdatePieSeries(String seriesName, Number value) Update a series by updating the pie slide valueMethods inherited from class org.knowm.xchart.internal.chartpart.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
-
PieChart
public PieChart(int width, int height) Constructor - the default Chart Theme will be used (XChartTheme)- Parameters:
width-height-
-
PieChart
Constructor- Parameters:
width-height-theme- - pass in a instance of Theme class, probably a custom Theme.
-
PieChart
Constructor- Parameters:
width-height-chartTheme- - pass in the desired ChartTheme enum
-
PieChart
Constructor- Parameters:
chartBuilder-
-
-
Method Details
-
addSeries
Add a series for a Pie type chart- Parameters:
seriesName-value-- Returns:
-
updatePieSeries
Update a series by updating the pie slide value- Parameters:
seriesName-value-- Returns:
-
paint
-
setSeriesStyles
private void setSeriesStyles()set the series color based on theme
-