public class

PieLabelDistributor

extends AbstractPieLabelDistributor
java.lang.Object
   ↳ org.jfree.chart.plot.AbstractPieLabelDistributor
     ↳ org.jfree.chart.plot.PieLabelDistributor

Class Overview

This class distributes the section labels for one side of a pie chart so that they do not overlap.

Summary

[Expand]
Inherited Fields
From class org.jfree.chart.plot.AbstractPieLabelDistributor
Public Constructors
PieLabelDistributor(int labelCount)
Creates a new distributor.
Public Methods
void distributeLabels(double minY, double height)
Distributes the labels.
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.
Protected Methods
void adjustDownwards(double minY, double height)
Any labels that are overlapping are moved down in an attempt to eliminate the overlaps.
void adjustInwards()
Adjusts the y-coordinate for the labels in towards the center in an attempt to fix overlapping.
void adjustUpwards(double minY, double height)
Any labels that are overlapping are moved up in an attempt to eliminate the overlaps.
void spreadEvenly(double minY, double height)
Labels are spaced evenly in the available space in an attempt to eliminate the overlaps.
[Expand]
Inherited Methods
From class org.jfree.chart.plot.AbstractPieLabelDistributor
From class java.lang.Object

Public Constructors

public PieLabelDistributor (int labelCount)

Creates a new distributor.

Parameters
labelCount the number of labels (ignored).

Public Methods

public void distributeLabels (double minY, double height)

Distributes the labels.

Parameters
minY the minimum y-coordinate in Java2D-space.
height the available height (in Java2D units).

public void sort ()

Sorts the label records into ascending order by y-value.

public String toString ()

Returns a string containing a description of the object for debugging purposes.

Returns
  • A string.

Protected Methods

protected void adjustDownwards (double minY, double height)

Any labels that are overlapping are moved down in an attempt to eliminate the overlaps.

Parameters
minY the minimum y value (in Java2D coordinate space).
height the height available for all labels.

protected void adjustInwards ()

Adjusts the y-coordinate for the labels in towards the center in an attempt to fix overlapping.

protected void adjustUpwards (double minY, double height)

Any labels that are overlapping are moved up in an attempt to eliminate the overlaps.

Parameters
minY the minimum y value (in Java2D coordinate space).
height the height available for all labels.

protected void spreadEvenly (double minY, double height)

Labels are spaced evenly in the available space in an attempt to eliminate the overlaps.

Parameters
minY the minimum y value (in Java2D coordinate space).
height the height available for all labels.