org.jfree.chart.labels

## Class StandardXYToolTipGenerator

- java.lang.Object
- - org.jfree.chart.labels.AbstractXYItemLabelGenerator
  - - org.jfree.chart.labels.StandardXYToolTipGenerator

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, XYToolTipGenerator, PublicCloneable

      public class StandardXYToolTipGenerator
      extends AbstractXYItemLabelGenerator
      implements XYToolTipGenerator, java.lang.Cloneable, PublicCloneable, java.io.Serializable

  A standard tool tip generator for use with an `XYItemRenderer`.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_TOOL_TIP_FORMAT` The default tooltip format.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardXYToolTipGenerator()` Creates a tool tip generator using default number formatters.
    `StandardXYToolTipGenerator(java.lang.String formatString, java.text.DateFormat xFormat, java.text.DateFormat yFormat)` Creates a tool tip generator using the specified date formatters.
    `StandardXYToolTipGenerator(java.lang.String formatString, java.text.DateFormat xFormat, java.text.NumberFormat yFormat)` Creates a tool tip generator using the specified number formatters.
    `StandardXYToolTipGenerator(java.lang.String formatString, java.text.NumberFormat xFormat, java.text.DateFormat yFormat)` Creates a tool tip generator using the specified formatters (a number formatter for the x-values and a date formatter for the y-values).
    `StandardXYToolTipGenerator(java.lang.String formatString, java.text.NumberFormat xFormat, java.text.NumberFormat yFormat)` Creates a tool tip generator using the specified number formatters.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `clone()` Returns an independent copy of the generator.
    `boolean` | `equals(java.lang.Object obj)` Tests this object for equality with an arbitrary object.
    `java.lang.String` | `generateToolTip(XYDataset dataset, int series, int item)` Generates the tool tip text for an item in a dataset.
    `static StandardXYToolTipGenerator` | `getTimeSeriesInstance()` Returns a tool tip generator that formats the x-values as dates and the y-values as numbers.

    - ### Methods inherited from class org.jfree.chart.labels.AbstractXYItemLabelGenerator

      `createItemArray, generateLabelString, getFormatString, getNullYString, getXDateFormat, getXFormat, getYDateFormat, getYFormat, hashCode`

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

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

- - ### Field Detail

    - #### DEFAULT_TOOL_TIP_FORMAT

          public static final java.lang.String DEFAULT_TOOL_TIP_FORMAT

      The default tooltip format.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StandardXYToolTipGenerator

          public StandardXYToolTipGenerator()

      Creates a tool tip generator using default number formatters.

    - #### StandardXYToolTipGenerator

          public StandardXYToolTipGenerator(java.lang.String formatString,
                                            java.text.NumberFormat xFormat,
                                            java.text.NumberFormat yFormat)

      Creates a tool tip generator using the specified number formatters.
      Parameters:
        `formatString` - the item label format string (`null` not permitted).
        `xFormat` - the format object for the x values (`null` not permitted).
        `yFormat` - the format object for the y values (`null` not permitted).

    - #### StandardXYToolTipGenerator

          public StandardXYToolTipGenerator(java.lang.String formatString,
                                            java.text.DateFormat xFormat,
                                            java.text.NumberFormat yFormat)

      Creates a tool tip generator using the specified number formatters.
      Parameters:
        `formatString` - the label format string (`null` not permitted).
        `xFormat` - the format object for the x values (`null` not permitted).
        `yFormat` - the format object for the y values (`null` not permitted).

    - #### StandardXYToolTipGenerator

          public StandardXYToolTipGenerator(java.lang.String formatString,
                                            java.text.NumberFormat xFormat,
                                            java.text.DateFormat yFormat)

      Creates a tool tip generator using the specified formatters (a number formatter for the x-values and a date formatter for the y-values).
      Parameters:
        `formatString` - the item label format string (`null` not permitted).
        `xFormat` - the format object for the x values (`null` permitted).
        `yFormat` - the format object for the y values (`null` not permitted).
      Since:
        1.0.4

    - #### StandardXYToolTipGenerator

          public StandardXYToolTipGenerator(java.lang.String formatString,
                                            java.text.DateFormat xFormat,
                                            java.text.DateFormat yFormat)

      Creates a tool tip generator using the specified date formatters.
      Parameters:
        `formatString` - the label format string (`null` not permitted).
        `xFormat` - the format object for the x values (`null` not permitted).
        `yFormat` - the format object for the y values (`null` not permitted).

  - ### Method Detail

    - #### getTimeSeriesInstance

          public static StandardXYToolTipGenerator getTimeSeriesInstance()

      Returns a tool tip generator that formats the x-values as dates and the y-values as numbers.
      Returns:
        A tool tip generator (never `null`).

    - #### generateToolTip

          public java.lang.String generateToolTip(XYDataset dataset,
                                                  int series,
                                                  int item)

      Generates the tool tip text for an item in a dataset.
      Specified by:
        `generateToolTip` in interface `XYToolTipGenerator`
      Parameters:
        `dataset` - the dataset (`null` not permitted).
        `series` - the series index (zero-based).
        `item` - the item index (zero-based).
      Returns:
        The tooltip text (possibly `null`).

    - #### equals

          public boolean equals(java.lang.Object obj)

      Tests this object for equality with an arbitrary object.
      Overrides:
        `equals` in class `AbstractXYItemLabelGenerator`
      Parameters:
        `obj` - the other object (`null` permitted).
      Returns:
        A boolean.

    - #### clone

          public java.lang.Object clone()
                                 throws java.lang.CloneNotSupportedException

      Returns an independent copy of the generator.
      Specified by:
        `clone` in interface `PublicCloneable`
      Overrides:
        `clone` in class `AbstractXYItemLabelGenerator`
      Returns:
        A clone.
      Throws:
        `java.lang.CloneNotSupportedException` - if cloning is not supported.