Package org.jfree.chart.plot
Class PieLabelDistributor
java.lang.Object
org.jfree.chart.plot.PieLabelDistributor
public class PieLabelDistributor extends Object
This class distributes the section labels for one side of a pie chart so that
they do not overlap.
-
Constructor Summary
Constructors Constructor Description PieLabelDistributor(int labelCount)
Creates a new distributor. -
Method Summary
Modifier and Type Method Description void
addPieLabelRecord(PieLabelRecord record)
Adds a label record.void
distributeLabels(double minY, double height)
Distributes the labels.int
getItemCount()
Returns the number of items in the list.PieLabelRecord
getPieLabelRecord(int index)
Returns a label record from the list.void
sort()
Sorts the label records into ascending order by y-value.String
toString()
Returns a string containing a description of the object for debugging purposes.
-
Constructor Details
-
PieLabelDistributor
public PieLabelDistributor(int labelCount)Creates a new distributor.- Parameters:
labelCount
- the number of labels.
-
-
Method Details
-
getPieLabelRecord
Returns a label record from the list.- Parameters:
index
- the index.- Returns:
- the label record.
-
addPieLabelRecord
Adds a label record.- Parameters:
record
- the label record.
-
getItemCount
public int getItemCount()Returns the number of items in the list.- Returns:
- the item count.
-
distributeLabels
public void distributeLabels(double minY, double height)Distributes the labels.- Parameters:
minY
- the minimum y-coordinate in Java2D-space.height
- the height.
-
sort
public void sort()Sorts the label records into ascending order by y-value. -
toString
Returns a string containing a description of the object for debugging purposes.
-