Class MultipleXYSeriesLabelGenerator

java.lang.Object
org.jfree.chart.labels.MultipleXYSeriesLabelGenerator
All Implemented Interfaces:
Serializable, Cloneable, XYSeriesLabelGenerator, PublicCloneable

A series label generator for plots that use data from an XYDataset.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • addSeriesLabel

      public void addSeriesLabel(int series, String label)
      Adds an extra label for the specified series.
      Parameters:
      series - the series index.
      label - the label.
    • clearSeriesLabels

      public void clearSeriesLabels(int series)
      Clears the extra labels for the specified series.
      Parameters:
      series - the series index.
    • generateLabel

      public String generateLabel(XYDataset dataset, int series)
      Generates a label for the specified series. This label will be used for the chart legend.
      Specified by:
      generateLabel in interface XYSeriesLabelGenerator
      Parameters:
      dataset - the dataset (null not permitted).
      series - the series.
      Returns:
      A series label.
    • createItemArray

      protected Object[] createItemArray(XYDataset dataset, int series)
      Creates the array of items that can be passed to the MessageFormat class for creating labels.
      Parameters:
      dataset - the dataset (null not permitted).
      series - the series (zero-based index).
      Returns:
      The items (never null).
    • clone

      Returns an independent copy of the generator.
      Specified by:
      clone in interface PublicCloneable
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if cloning is not supported.
    • equals

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

      public int hashCode()
      Returns a hash code for this instance.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code.