com.orsoncharts.label

## Class StandardXYZLabelGenerator

- java.lang.Object
- - com.orsoncharts.label.StandardXYZLabelGenerator

- All Implemented Interfaces:
    XYZLabelGenerator, java.io.Serializable

      public class StandardXYZLabelGenerator
      extends java.lang.Object
      implements XYZLabelGenerator, java.io.Serializable

  A default implementation of the `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`).
  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:
    Serialized Form

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `StandardXYZLabelGenerator()` The default constructor.
    `StandardXYZLabelGenerator(java.lang.String template)` Creates a new instance with the specified label template.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### KEY_ONLY_TEMPLATE

          public static final java.lang.String KEY_ONLY_TEMPLATE

      A label template that will display the series key only.
      See Also:
        Constant Field Values

    - #### TOTAL_TEMPLATE

          public static final 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.
      See Also:
        Constant Field Values

    - #### TOTAL_TEMPLATE_2DP

          public static final 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.
      See Also:
        Constant Field Values

    - #### COUNT_TEMPLATE

          public static final 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).
      See Also:
        Constant Field Values

    - #### DEFAULT_TEMPLATE

          public static final java.lang.String DEFAULT_TEMPLATE

      The default label template.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StandardXYZLabelGenerator

          public StandardXYZLabelGenerator()

      The default constructor.

    - #### StandardXYZLabelGenerator

          public StandardXYZLabelGenerator(java.lang.String template)

      Creates a new instance with the specified label template.
      Parameters:
        `template` - the label template (`null` not permitted).

  - ### Method Detail

    - #### generateSeriesLabel

          public java.lang.String generateSeriesLabel(XYZDataset dataset,
                                                      java.lang.Comparable<?> seriesKey)

      Generates a series label.
      Specified by:
        `generateSeriesLabel` in interface `XYZLabelGenerator`
      Parameters:
        `dataset` - the dataset (`null` not permitted).
        `seriesKey` - the series key (`null` not permitted).
      Returns:
        The series label (possibly `null`).

    - #### equals

          public boolean equals(java.lang.Object obj)

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

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`