Class PieChart

All Implemented Interfaces:
Styleable, EventTarget

public class PieChart extends Chart
Displays a PieChart. The chart content is populated by pie slices based on data set on the PieChart.

The clockwise property is set to true by default, which means slices are placed in the clockwise order. The labelsVisible property is used to either display pie slice labels or not.

Since:
JavaFX 2.0
  • Property Details

  • Constructor Details

    • PieChart

      public PieChart()
      Construct a new empty PieChart.
    • PieChart

      public PieChart(ObservableList<PieChart.Data> data)
      Construct a new PieChart with the given data
      Parameters:
      data - The data to use, this is the actual list used so any changes to it will be reflected in the chart
  • Method Details

    • getData

      public final ObservableList<PieChart.Data> getData()
      Gets the value of the property data.
      Property description:
      PieCharts data
    • setData

      public final void setData(ObservableList<PieChart.Data> value)
      Sets the value of the property data.
      Property description:
      PieCharts data
    • dataProperty

      public final ObjectProperty<ObservableList<PieChart.Data>> dataProperty()
      PieCharts data
      See Also:
    • getStartAngle

      public final double getStartAngle()
      Gets the value of the property startAngle.
      Property description:
      The angle to start the first pie slice at
    • setStartAngle

      public final void setStartAngle(double value)
      Sets the value of the property startAngle.
      Property description:
      The angle to start the first pie slice at
    • startAngleProperty

      public final DoubleProperty startAngleProperty()
      The angle to start the first pie slice at
      See Also:
    • setClockwise

      public final void setClockwise(boolean value)
      Sets the value of the property clockwise.
      Property description:
      When true we start placing slices clockwise from the startAngle
    • isClockwise

      public final boolean isClockwise()
      Gets the value of the property clockwise.
      Property description:
      When true we start placing slices clockwise from the startAngle
    • clockwiseProperty

      public final BooleanProperty clockwiseProperty()
      When true we start placing slices clockwise from the startAngle
      See Also:
    • getLabelLineLength

      public final double getLabelLineLength()
      Gets the value of the property labelLineLength.
      Property description:
      The length of the line from the outside of the pie to the slice labels.
    • setLabelLineLength

      public final void setLabelLineLength(double value)
      Sets the value of the property labelLineLength.
      Property description:
      The length of the line from the outside of the pie to the slice labels.
    • labelLineLengthProperty

      public final DoubleProperty labelLineLengthProperty()
      The length of the line from the outside of the pie to the slice labels.
      See Also:
    • setLabelsVisible

      public final void setLabelsVisible(boolean value)
      Sets the value of the property labelsVisible.
      Property description:
      When true pie slice labels are drawn
    • getLabelsVisible

      public final boolean getLabelsVisible()
      Indicates whether pie slice labels are drawn or not
      Returns:
      true if pie slice labels are visible and false otherwise.
    • labelsVisibleProperty

      public final BooleanProperty labelsVisibleProperty()
      When true pie slice labels are drawn
      See Also:
    • layoutChartChildren

      protected void layoutChartChildren(double top, double left, double contentWidth, double contentHeight)
      Called to update and layout the chart children available from getChartChildren()
      Specified by:
      layoutChartChildren in class Chart
      Parameters:
      top - The top offset from the origin to account for any padding on the chart content
      left - The left offset from the origin to account for any padding on the chart content
      contentWidth - The width of the area to layout the chart within
      contentHeight - The height of the area to layout the chart within
    • getClassCssMetaData

      public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
      Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
      Returns:
      the CssMetaData
      Since:
      JavaFX 8.0
    • getCssMetaData

      public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
      This method should delegate to Node.getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.
      Specified by:
      getCssMetaData in interface Styleable
      Overrides:
      getCssMetaData in class Chart
      Returns:
      The CssMetaData associated with this node, which may include the CssMetaData of its superclasses.
      Since:
      JavaFX 8.0