Package org.knowm.xchart.style
Class PieStyler
- java.lang.Object
-
- org.knowm.xchart.style.Styler
-
- org.knowm.xchart.style.PieStyler
-
public class PieStyler extends Styler
- Author:
- timmolter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PieStyler.AnnotationType
-
Nested classes/interfaces inherited from class org.knowm.xchart.style.Styler
Styler.ChartTheme, Styler.LegendLayout, Styler.LegendPosition, Styler.TextAlignment, Styler.ToolTipType, Styler.YAxisPosition
-
-
Constructor Summary
Constructors Constructor Description PieStyler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAnnotationDistance()
PieStyler.AnnotationType
getAnnotationType()
PieSeries.PieSeriesRenderStyle
getDefaultSeriesRenderStyle()
double
getDonutThickness()
double
getStartAngleInDegrees()
Font
getSumFont()
boolean
isCircular()
boolean
isDrawAllAnnotations()
boolean
isSumVisible()
void
setAnnotationDistance(double annotationDistance)
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.PieStyler
setAnnotationType(PieStyler.AnnotationType annotationType)
Sets the Pie chart's annotation typePieStyler
setCircular(boolean isCircular)
Sets whether or not the pie chart is forced to be circular.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.void
setDonutThickness(double donutThickness)
Sets the thickness of the donut ring for donut style pie chart series.PieStyler
setDrawAllAnnotations(boolean drawAllAnnotations)
By default, only the annotations that will "fit", as determined algorithmically, will be drawn.PieStyler
setStartAngleInDegrees(double startAngleInDegrees)
Sets the start angle in degrees.PieStyler
setSumFont(Font sumFont)
Sets the font for the sum.PieStyler
setSumFontSize(float sumFontSize)
Sets the font size for the sum.PieStyler
setSumVisible(boolean isSumVisible)
Sets whether or not the sum is visible in the centre of the pie chart.PieStyler
setTheme(Theme theme)
Set the theme the styler should use-
Methods inherited from class org.knowm.xchart.style.Styler
getAnnotationsFont, getAntiAlias, getBaseFont, getChartBackgroundColor, getChartFontColor, getChartPadding, getChartTitleBoxBackgroundColor, getChartTitleBoxBorderColor, getChartTitleFont, getChartTitlePadding, getDecimalPattern, getLegendBackgroundColor, getLegendBorderColor, getLegendFont, getLegendLayout, getLegendPadding, getLegendPosition, getLegendSeriesLineLength, getPlotBackgroundColor, getPlotBorderColor, getPlotContentSize, getSeriesColors, getSeriesLines, getSeriesMarkers, getTheme, getToolTipBackgroundColor, getToolTipBorderColor, getToolTipFont, getToolTipHighlightColor, getToolTipType, getYAxisGroupPosistion, hasAnnotations, isChartTitleBoxVisible, isChartTitleVisible, isLegendVisible, isPlotBorderVisible, isToolTipsAlwaysVisible, isToolTipsEnabled, setAnnotationsFont, setAntiAlias, setBaseFont, setChartBackgroundColor, setChartFontColor, setChartPadding, setChartTitleBoxBackgroundColor, setChartTitleBoxBorderColor, setChartTitleBoxVisible, setChartTitleFont, setChartTitlePadding, setChartTitleVisible, setDecimalPattern, setHasAnnotations, setLegendBackgroundColor, setLegendBorderColor, setLegendFont, setLegendLayout, setLegendPadding, setLegendPosition, setLegendSeriesLineLength, setLegendVisible, setPlotBackgroundColor, setPlotBorderColor, setPlotBorderVisible, setPlotContentSize, setSeriesColors, setSeriesLines, setSeriesMarkers, setToolTipBackgroundColor, setToolTipBorderColor, setToolTipFont, setToolTipHighlightColor, setToolTipsAlwaysVisible, setToolTipsEnabled, setToolTipType, setYAxisGroupPosition
-
-
-
-
Method Detail
-
getDefaultSeriesRenderStyle
public PieSeries.PieSeriesRenderStyle 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
public PieStyler setCircular(boolean isCircular)
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
public PieStyler setStartAngleInDegrees(double startAngleInDegrees)
Sets the start angle in degrees. Zero degrees is straight up.- Parameters:
startAngleInDegrees
-
-
getAnnotationDistance
public double getAnnotationDistance()
-
setAnnotationDistance
public void setAnnotationDistance(double annotationDistance)
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:
annotationDistance
-
-
getAnnotationType
public PieStyler.AnnotationType getAnnotationType()
-
setAnnotationType
public PieStyler setAnnotationType(PieStyler.AnnotationType annotationType)
Sets the Pie chart's annotation type- Parameters:
annotationType
-
-
isDrawAllAnnotations
public boolean isDrawAllAnnotations()
-
setDrawAllAnnotations
public PieStyler setDrawAllAnnotations(boolean drawAllAnnotations)
By default, only the annotations 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:
drawAllAnnotations
-
-
getDonutThickness
public double getDonutThickness()
-
setDonutThickness
public void setDonutThickness(double donutThickness)
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()
-
setSumVisible
public PieStyler setSumVisible(boolean isSumVisible)
Sets whether or not the sum is visible in the centre of the pie chart.- Parameters:
isSumVisible
-
-
getSumFont
public Font getSumFont()
-
setSumFont
public PieStyler setSumFont(Font sumFont)
Sets the font for the sum.- Parameters:
sumFont
- font
-
setSumFontSize
public PieStyler setSumFontSize(float sumFontSize)
Sets the font size for the sum.- Parameters:
sumFontSize
-
-
-