org.openi.chart
Class LabelGenerator

java.lang.Object
  extended byorg.openi.chart.LabelGenerator
All Implemented Interfaces:
org.jfree.chart.labels.CategoryLabelGenerator

public class LabelGenerator
extends java.lang.Object
implements org.jfree.chart.labels.CategoryLabelGenerator

Author:
plucas TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
LabelGenerator(int category)
          Creates a new label generator that displays the item value and a percentage relative to the value in the same series for the specified category.
LabelGenerator(java.lang.Integer category)
          Creates a new label generator that displays the item value and a percentage relative to the value in the same series for the specified category.
 
Method Summary
 java.lang.String generateLabel(org.jfree.data.category.CategoryDataset dataset, int series, int category)
          Generates a label for the specified item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelGenerator

public LabelGenerator(int category)
Creates a new label generator that displays the item value and a percentage relative to the value in the same series for the specified category.

Parameters:
category - the category index (zero-based).

LabelGenerator

public LabelGenerator(java.lang.Integer category)
Creates a new label generator that displays the item value and a percentage relative to the value in the same series for the specified category. If the category index is null, the total of all items in the series is used.

Parameters:
category - the category index (null permitted).
Method Detail

generateLabel

public java.lang.String generateLabel(org.jfree.data.category.CategoryDataset dataset,
                                      int series,
                                      int category)
Generates a label for the specified item. The label is typically a formatted version of the data value, but any text can be used.

Specified by:
generateLabel in interface org.jfree.chart.labels.CategoryLabelGenerator
Parameters:
dataset - the dataset (null not permitted).
series - the series index (zero-based).
category - the category index (zero-based).
Returns:
the label (possibly null).