Class StandardPieLabelGenerator

java.lang.Object
org.jfree.chart3d.label.StandardPieLabelGenerator
All Implemented Interfaces:
Serializable, PieLabelGenerator

A default implementation of the PieLabelGenerator interface. The implementation uses a Formatter instance to generate the labels. Three values are passed to the formatter: (1) the key for the current pie section, (2) the data value for the section (as a Double, possibly null) and (3) the calculated percentage value (as a Double, Double.NaN if the value is null).

NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
Since:
1.2
See Also:
  • Field Details

  • Constructor Details

    • StandardPieLabelGenerator

      The default constructor, uses DEFAULT_TEMPLATE for the template string.
    • StandardPieLabelGenerator

      Creates a new instance with the specified template string (which will be passed to a java.util.Formatter instance when generating labels). See the class description for an explanation of the values that are available for use in the template string.
      Parameters:
      template - the template (null not permitted).
  • Method Details

    • generateLabel

      public String generateLabel(PieDataset3D dataset, Comparable<?> key)
      Generates the label for one section in a pie chart.
      Specified by:
      generateLabel in interface PieLabelGenerator
      Parameters:
      dataset - the dataset (null not permitted).
      key - the key (null not permitted).
      Returns:
      The label (never null for this implementation).
    • equals

      public boolean equals(Object obj)
      Tests this label generator for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object