Package com.independentsoft.office.odf.charts

# Class Legend

java.lang.Object
com.independentsoft.office.odf.charts.Legend

All Implemented Interfaces:
  `IContentElement`

public class Legend extends Object implements IContentElement
Represents a legend for a chart.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Legend()`
  Initializes a new instance of the Legend class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Legend`
  `clone()`
  Creates a new object that is a deep copy of the current instance.
  `LegendAlign`
  `getAlign()`
  Gets the alignment of a legend with the plot area.
  `List<IContentElement>`
  `getContentElements()`
  Returns all content elements.
  `LegendExpansion`
  `getExpansion()`
  Gets the direction in which a legend expands while accommodating new entries.
  `double`
  `getExpansionAspectRatio()`
  Gets the ratio between width and height for a Legend object.
  `IContentElement`
  `getParent()`
  Returns the parent content element.
  `LegendPosition`
  `getPosition()`
  Gets the placement of a legend.
  `String`
  `getStyle()`
  Gets name that reference style mechanisms.
  `Size`
  `getX()`
  Gets the X coordinate.
  `Size`
  `getY()`
  Gets the Y coordinate.
  `void`
  `setAlign​(LegendAlign align)`
  Sets the alignment of a legend with the plot area.
  `void`
  `setExpansion​(LegendExpansion expansion)`
  Sets the direction in which a legend expands while accommodating new entries.
  `void`
  `setExpansionAspectRatio​(double expansionAspectRatio)`
  Sets the ratio between width and height for a Legend object.
  `void`
  `setParent​(IContentElement parent)`
  Sets the parent content element.
  `void`
  `setPosition​(LegendPosition position)`
  Sets the placement of a legend.
  `void`
  `setStyle​(String style)`
  Sets name that reference style mechanisms.
  `void`
  `setX​(Size x)`
  Sets the X coordinate.
  `void`
  `setY​(Size y)`
  Sets the Y coordinate.
  `String`
  `toString()`
  Converts the value of the current Legend object to its equivalent string representation.

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

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Legend

    public Legend()
    Initializes a new instance of the Legend class.

- ## Method Details

  - ### getContentElements

    public List<IContentElement> getContentElements()
    Returns all content elements.
    Specified by:
      `getContentElements` in interface `IContentElement`
    Returns:
      A collection of content elements.

  - ### getParent

    public IContentElement getParent()
    Returns the parent content element.
    Specified by:
      `getParent` in interface `IContentElement`
    Returns:
      the parent

  - ### setParent

    public void setParent​(IContentElement parent)
    Sets the parent content element.
    Specified by:
      `setParent` in interface `IContentElement`
    Parameters:
      `parent` - the new parent

  - ### clone

    public Legend clone()
    Creates a new object that is a deep copy of the current instance.
    Specified by:
      `clone` in interface `IContentElement`
    Overrides:
      `clone` in class `Object`
    Returns:
      A new object that is a copy of this instance.

  - ### toString

    public String toString()
    Converts the value of the current Legend object to its equivalent string representation.
    Overrides:
      `toString` in class `Object`
    Returns:
      the string

  - ### getPosition

    public LegendPosition getPosition()
    Gets the placement of a legend.
    Returns:
      the position

  - ### setPosition

    public void setPosition​(LegendPosition position)
    Sets the placement of a legend.
    Parameters:
      `position` - the new position

  - ### getAlign

    public LegendAlign getAlign()
    Gets the alignment of a legend with the plot area. The defined values are: - center: legend is aligned at the center of the plot-area. - end: legend is aligned at the end of the plot-area (which is right or bottom). - start: legend is aligned at the beginning of the plot-area (which is left or top).
    Returns:
      the align

  - ### setAlign

    public void setAlign​(LegendAlign align)
    Sets the alignment of a legend with the plot area. The defined values are: - center: legend is aligned at the center of the plot-area. - end: legend is aligned at the end of the plot-area (which is right or bottom). - start: legend is aligned at the beginning of the plot-area (which is left or top).
    Parameters:
      `align` - the new align

  - ### getExpansion

    public LegendExpansion getExpansion()
    Gets the direction in which a legend expands while accommodating new entries. The defined values are: - balanced: legend expands horizontally and vertically. - custom: with a style:legend-expansion-aspect-ratio attribute legend expands according to the specified ratio. - high: legend expands vertically. - wide: legend expands horizontally.
    Returns:
      the expansion

  - ### setExpansion

    public void setExpansion​(LegendExpansion expansion)
    Sets the direction in which a legend expands while accommodating new entries. The defined values are: - balanced: legend expands horizontally and vertically. - custom: with a style:legend-expansion-aspect-ratio attribute legend expands according to the specified ratio. - high: legend expands vertically. - wide: legend expands horizontally.
    Parameters:
      `expansion` - the new expansion

  - ### getExpansionAspectRatio

    public double getExpansionAspectRatio()
    Gets the ratio between width and height for a Legend object.
    Returns:
      the expansion aspect ratio

  - ### setExpansionAspectRatio

    public void setExpansionAspectRatio​(double expansionAspectRatio)
    Sets the ratio between width and height for a Legend object.
    Parameters:
      `expansionAspectRatio` - the new expansion aspect ratio

  - ### getStyle

    public String getStyle()
    Gets name that reference style mechanisms.
    Returns:
      the style

  - ### setStyle

    public void setStyle​(String style)
    Sets name that reference style mechanisms.
    Parameters:
      `style` - the new style

  - ### getX

    public Size getX()
    Gets the X coordinate.
    Returns:
      the x

  - ### setX

    public void setX​(Size x)
    Sets the X coordinate.
    Parameters:
      `x` - the new x

  - ### getY

    public Size getY()
    Gets the Y coordinate.
    Returns:
      the y

  - ### setY

    public void setY​(Size y)
    Sets the Y coordinate.
    Parameters:
      `y` - the new y