Package org.knowm.xchart.style
Class PieStyler
java.lang.Object
org.knowm.xchart.style.Styler
org.knowm.xchart.style.PieStyler
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
Nested classes/interfaces inherited from class org.knowm.xchart.style.Styler
Styler.ChartButtonPosition, Styler.ChartTheme, Styler.LegendLayout, Styler.LegendPosition, Styler.ToolTipType, Styler.YAxisPosition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
double
getLabelsFontColor
(Color backgroundColor) float
double
Access the current sumFormat value, a value of "" or null implies use the original sum formatted using the PieStyler DecimalFormat.boolean
boolean
boolean
boolean
boolean
setCircular
(boolean isCircular) Sets whether or not the pie chart is forced to be circular.setClockwiseDirectionType
(PieStyler.ClockwiseDirectionType clockwiseDirectionType) setDefaultSeriesRenderStyle
(PieSeries.PieSeriesRenderStyle chartPieSeriesRenderStyle) Sets the default series render style for the chart (line, scatter, area, etc.) You can override the series render style individually on each Series object.setDonutThickness
(double donutThickness) Sets the thickness of the donut ring for donut style pie chart series.setForceAllLabelsVisible
(boolean forceAllLabelsVisible) By default, only the labels that will "fit", as determined algorithmically, will be drawn.void
setLabelsDistance
(double labelsDistance) Sets the distance of the pie chart's annotation where 0 is the center, 1 is at the edge and greater than 1 is outside of the pie chart.setLabelsFont
(Font labelsFont) Sets the Font used for chart annotationssetLabelsFontColor
(Color labelsFontColor) Sets the color of the Font used for chart annotationssetLabelsFontColorAutomaticDark
(Color labelsFontColorAutomaticDark) setLabelsFontColorAutomaticEnabled
(boolean isLabelsFontColorAutomaticEnabled) setLabelsFontColorAutomaticLight
(Color labelsFontColorAutomaticLight) setLabelsVisible
(boolean labelsVisible) Sets if annotations should be added to charts.setLabelType
(PieStyler.LabelType labelType) Sets the Pie chart's annotation typesetSliceBorderWidth
(double sliceBorderWidth) setStartAngleInDegrees
(double startAngleInDegrees) Sets the start angle in degrees.setSumFont
(Font sumFont) Sets the font for the sum.setSumFontSize
(float sumFontSize) Sets the font size for the sum.setSumFormat
(String sumFormat) Set the Format to be applied to the sum, the default is just to display the sum as a number using the PieStyler DecimalFormat.setSumVisible
(boolean isSumVisible) Sets whether or not the sum is visible in the centre of the pie chart.Set the theme the styler should useMethods inherited from class org.knowm.xchart.style.Styler
getAnnotationLineColor, getAnnotationLineStroke, getAnnotationTextFont, getAnnotationTextFontColor, getAnnotationTextPanelBackgroundColor, getAnnotationTextPanelBorderColor, getAnnotationTextPanelFont, getAnnotationTextPanelFontColor, getAnnotationTextPanelPadding, getAntiAlias, getBaseFont, getChartBackgroundColor, getChartButtonBackgroundColor, getChartButtonBorderColor, getChartButtonFont, getChartButtonFontColor, getChartButtonMargin, getChartButtonPosition, getChartFontColor, getChartPadding, getChartTitleBoxBackgroundColor, getChartTitleBoxBorderColor, getChartTitleFont, getChartTitlePadding, getDecimalPattern, getLegendBackgroundColor, getLegendBorderColor, getLegendFont, getLegendLayout, getLegendPadding, getLegendPosition, getLegendSeriesLineLength, getMarkerSize, getPlotBackgroundColor, getPlotBorderColor, getPlotContentSize, getSeriesColors, getSeriesLines, getSeriesMarkers, getShowWithinAreaPoint, getTheme, getToolTipBackgroundColor, getToolTipBorderColor, getToolTipFont, getToolTipHighlightColor, getToolTipType, getXAxisTitleColor, getYAxisGroupPosistion, getYAxisGroupTitleColor, getYAxisLeftWidthHint, getYAxisTitleColor, isChartTitleBoxVisible, isChartTitleVisible, isLegendVisible, isPlotBorderVisible, isToolTipsAlwaysVisible, isToolTipsEnabled, setAnnotationLineColor, setAnnotationLineStroke, setAnnotationTextFont, setAnnotationTextFontColor, setAnnotationTextPanelBackgroundColor, setAnnotationTextPanelBorderColor, setAnnotationTextPanelFont, setAnnotationTextPanelFontColor, setAnnotationTextPanelPadding, setAntiAlias, setBaseFont, setChartBackgroundColor, setChartButtonBackgroundColor, setChartButtonBorderColor, setChartButtonFont, setChartButtonFontColor, setChartButtonMargin, setChartButtonPosition, setChartFontColor, setChartPadding, setChartTitleBoxBackgroundColor, setChartTitleBoxBorderColor, setChartTitleBoxVisible, setChartTitleFont, setChartTitlePadding, setChartTitleVisible, setDecimalPattern, setLegendBackgroundColor, setLegendBorderColor, setLegendFont, setLegendLayout, setLegendPadding, setLegendPosition, setLegendSeriesLineLength, setLegendVisible, setMarkerSize, setPlotBackgroundColor, setPlotBorderColor, setPlotBorderVisible, setPlotContentSize, setSeriesColors, setSeriesLines, setSeriesMarkers, setShowWithinAreaPoint, setToolTipBackgroundColor, setToolTipBorderColor, setToolTipFont, setToolTipHighlightColor, setToolTipsAlwaysVisible, setToolTipsEnabled, setToolTipType, setXAxisTitleColor, setYAxisGroupPosition, setYAxisGroupTitleColor, setYAxisLeftWidthHint, setYAxisTitleColor
-
Constructor Details
-
PieStyler
public PieStyler()
-
-
Method Details
-
getDefaultSeriesRenderStyle
-
setDefaultSeriesRenderStyle
public PieStyler setDefaultSeriesRenderStyle(PieSeries.PieSeriesRenderStyle chartPieSeriesRenderStyle) Sets the default series render style for the chart (line, scatter, area, etc.) You can override the series render style individually on each Series object.- Parameters:
chartPieSeriesRenderStyle
-
-
isCircular
public boolean isCircular() -
setCircular
Sets whether or not the pie chart is forced to be circular. Otherwise it's shape is oval, matching the containing plot.- Parameters:
isCircular
-
-
getStartAngleInDegrees
public double getStartAngleInDegrees() -
setStartAngleInDegrees
Sets the start angle in degrees. Zero degrees is straight up.- Parameters:
startAngleInDegrees
-
-
getLabelsDistance
public double getLabelsDistance() -
setLabelsDistance
public void setLabelsDistance(double labelsDistance) Sets the distance of the pie chart's annotation where 0 is the center, 1 is at the edge and greater than 1 is outside of the pie chart.- Parameters:
labelsDistance
-
-
getLabelType
-
setLabelType
Sets the Pie chart's annotation type- Parameters:
labelType
-
-
isForceAllLabelsVisible
public boolean isForceAllLabelsVisible() -
setForceAllLabelsVisible
By default, only the labels that will "fit", as determined algorithmically, will be drawn. Otherwise, you can end up with annotations drawn overlapping. If `drawAllAnnotations` is set true with this method, it will override the algorithmic determination, and always draw all the annotations, one for each slice. You can also try playing around with the method `setStartAngleInDegrees` so the the slices are orientated in a more optimal way. You can also try changing the font size. Also, you can order the slices so that a small slice is followed by a larger slice, while setting this method with `true`.- Parameters:
forceAllLabelsVisible
-
-
getDonutThickness
public double getDonutThickness() -
setDonutThickness
Sets the thickness of the donut ring for donut style pie chart series.- Parameters:
donutThickness
- - Valid range is between 0 and 1.
-
isSumVisible
public boolean isSumVisible() -
setSumFormat
Set the Format to be applied to the sum, the default is just to display the sum as a number using the PieStyler DecimalFormat. This allows a separate Formatter @see java.util.Formatter#format()- Parameters:
sumFormat
- Format to use for the sum display, the Double sum value will be passed to this to generate the overall sum string.- Returns:
- PieStyler so that modifiers can be chained.
-
getSumFormat
Access the current sumFormat value, a value of "" or null implies use the original sum formatted using the PieStyler DecimalFormat.- Returns:
- Formatter string to be used when displaying the sum value or
null
-
setSumVisible
Sets whether or not the sum is visible in the centre of the pie chart.- Parameters:
isSumVisible
-
-
getSumFont
-
setSumFont
Sets the font for the sum.- Parameters:
sumFont
- font
-
setSumFontSize
Sets the font size for the sum.- Parameters:
sumFontSize
-
-
isLabelsVisible
public boolean isLabelsVisible() -
setLabelsVisible
Sets if annotations should be added to charts. Each chart type has a different annotation type- Parameters:
labelsVisible
-
-
getLabelsFont
-
setLabelsFont
Sets the Font used for chart annotations- Parameters:
labelsFont
-
-
getLabelsFontColor
-
getLabelsFontColor
-
setLabelsFontColor
Sets the color of the Font used for chart annotations- Parameters:
labelsFontColor
-
-
isLabelsFontColorAutomaticEnabled
public boolean isLabelsFontColorAutomaticEnabled() -
setLabelsFontColorAutomaticEnabled
-
getLabelsFontColorAutomaticLight
-
setLabelsFontColorAutomaticLight
-
getLabelsFontColorAutomaticDark
-
setLabelsFontColorAutomaticDark
-
setTheme
Set the theme the styler should use- Parameters:
theme
-
-
getClockwiseDirectionType
-
setClockwiseDirectionType
-
setSliceBorderWidth
-
getSliceBorderWidth
public float getSliceBorderWidth()
-