Class PieStyler


  • public class PieStyler
    extends Styler
    • Field Detail

      • isCircular

        private boolean isCircular
      • startAngleInDegrees

        private double startAngleInDegrees
      • donutThickness

        private double donutThickness
      • isSumVisible

        private boolean isSumVisible
      • sumFont

        private java.awt.Font sumFont
      • sumFormat

        private java.lang.String sumFormat
      • sliceBorderWidth

        private float sliceBorderWidth
      • isLabelsVisible

        private boolean isLabelsVisible
      • labelsFont

        private java.awt.Font labelsFont
      • labelsFontColor

        private java.awt.Color labelsFontColor
      • labelsDistance

        private double labelsDistance
      • isForceAllLabelsVisible

        private boolean isForceAllLabelsVisible
      • isLabelsFontColorAutomaticEnabled

        private boolean isLabelsFontColorAutomaticEnabled
      • labelsFontColorAutomaticLight

        private java.awt.Color labelsFontColorAutomaticLight
      • labelsFontColorAutomaticDark

        private java.awt.Color labelsFontColorAutomaticDark
    • Constructor Detail

      • PieStyler

        public PieStyler()
    • Method Detail

      • 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 -
      • getLabelsDistance

        public double getLabelsDistance()
      • setLabelsDistance

        public PieStyler 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 -
      • setLabelType

        public PieStyler setLabelType​(PieStyler.LabelType labelType)
        Sets the Pie chart's annotation type
        Parameters:
        labelType -
      • isForceAllLabelsVisible

        public boolean isForceAllLabelsVisible()
      • setForceAllLabelsVisible

        public PieStyler setForceAllLabelsVisible​(boolean forceAllLabelsVisible)
        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

        public PieStyler 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()
      • setSumFormat

        public PieStyler setSumFormat​(java.lang.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. 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

        public java.lang.String 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

        public PieStyler setSumVisible​(boolean isSumVisible)
        Sets whether or not the sum is visible in the centre of the pie chart.
        Parameters:
        isSumVisible -
      • getSumFont

        public java.awt.Font getSumFont()
      • setSumFont

        public PieStyler setSumFont​(java.awt.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 -
      • isLabelsVisible

        public boolean isLabelsVisible()
      • setLabelsVisible

        public PieStyler setLabelsVisible​(boolean labelsVisible)
        Sets if annotations should be added to charts. Each chart type has a different annotation type
        Parameters:
        labelsVisible -
      • getLabelsFont

        public java.awt.Font getLabelsFont()
      • setLabelsFont

        public PieStyler setLabelsFont​(java.awt.Font labelsFont)
        Sets the Font used for chart annotations
        Parameters:
        labelsFont -
      • getLabelsFontColor

        public java.awt.Color getLabelsFontColor()
      • getLabelsFontColor

        public java.awt.Color getLabelsFontColor​(java.awt.Color backgroundColor)
      • setLabelsFontColor

        public PieStyler setLabelsFontColor​(java.awt.Color labelsFontColor)
        Sets the color of the Font used for chart annotations
        Parameters:
        labelsFontColor -
      • isLabelsFontColorAutomaticEnabled

        public boolean isLabelsFontColorAutomaticEnabled()
      • setLabelsFontColorAutomaticEnabled

        public PieStyler setLabelsFontColorAutomaticEnabled​(boolean isLabelsFontColorAutomaticEnabled)
      • getLabelsFontColorAutomaticLight

        public java.awt.Color getLabelsFontColorAutomaticLight()
      • setLabelsFontColorAutomaticLight

        public PieStyler setLabelsFontColorAutomaticLight​(java.awt.Color labelsFontColorAutomaticLight)
      • getLabelsFontColorAutomaticDark

        public java.awt.Color getLabelsFontColorAutomaticDark()
      • setLabelsFontColorAutomaticDark

        public PieStyler setLabelsFontColorAutomaticDark​(java.awt.Color labelsFontColorAutomaticDark)
      • setTheme

        public PieStyler setTheme​(Theme theme)
        Set the theme the styler should use
        Parameters:
        theme -
      • setSliceBorderWidth

        public PieStyler setSliceBorderWidth​(double sliceBorderWidth)
      • getSliceBorderWidth

        public float getSliceBorderWidth()