public class StandardXYZLabelGenerator extends java.lang.Object implements XYZLabelGenerator, java.io.Serializable
XYZLabelGenerator interface.
The implementation uses a Formatter instance to generate
the labels, which are typically used as the series labels in the chart
legend. Three values are passed to the formatter for possible inclusion
in the resulting label: (1) the key for the series, (2) the count for the
number of items in the series (as an Integer) and (3) the total
of the non-NaN values in the series (as a Double).
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COUNT_TEMPLATE
A label template that will display the series key followed by the
number of data items for the series (in brackets).
|
static java.lang.String |
DEFAULT_TEMPLATE
The default label template.
|
static java.lang.String |
KEY_ONLY_TEMPLATE
A label template that will display the series key only.
|
static java.lang.String |
TOTAL_TEMPLATE
A label template that will display the series key followed by the
total of the data items for the series (in brackets) with zero decimal
places.
|
static java.lang.String |
TOTAL_TEMPLATE_2DP
A label template that will display the series key followed by the
total of the data items for the series (in brackets) with zero decimal
places.
|
| Constructor and Description |
|---|
StandardXYZLabelGenerator()
The default constructor.
|
StandardXYZLabelGenerator(java.lang.String template)
Creates a new instance with the specified label template.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests this label generator for equality with an arbitrary object.
|
java.lang.String |
generateSeriesLabel(XYZDataset dataset,
java.lang.Comparable<?> seriesKey)
Generates a series label.
|
int |
hashCode() |
public static final java.lang.String KEY_ONLY_TEMPLATE
public static final java.lang.String TOTAL_TEMPLATE
public static final java.lang.String TOTAL_TEMPLATE_2DP
public static final java.lang.String COUNT_TEMPLATE
public static final java.lang.String DEFAULT_TEMPLATE
public StandardXYZLabelGenerator()
public StandardXYZLabelGenerator(java.lang.String template)
template - the label template (null not permitted).public java.lang.String generateSeriesLabel(XYZDataset dataset, java.lang.Comparable<?> seriesKey)
generateSeriesLabel in interface XYZLabelGeneratordataset - the dataset (null not permitted).seriesKey - the series key (null not permitted).null).public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public int hashCode()
hashCode in class java.lang.Object