Class Legend
java.lang.Object
com.independentsoft.office.odf.charts.Legend
- All Implemented Interfaces:
IContentElement
Represents a legend for a chart.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a new object that is a deep copy of the current instance.getAlign()Gets the alignment of a legend with the plot area.Returns all content elements.Gets the direction in which a legend expands while accommodating new entries.doubleGets the ratio between width and height for a Legend object.Returns the parent content element.Gets the placement of a legend.getStyle()Gets name that reference style mechanisms.getX()Gets the X coordinate.getY()Gets the Y coordinate.voidsetAlign(LegendAlign align)Sets the alignment of a legend with the plot area.voidsetExpansion(LegendExpansion expansion)Sets the direction in which a legend expands while accommodating new entries.voidsetExpansionAspectRatio(double expansionAspectRatio)Sets the ratio between width and height for a Legend object.voidsetParent(IContentElement parent)Sets the parent content element.voidsetPosition(LegendPosition position)Sets the placement of a legend.voidSets name that reference style mechanisms.voidSets the X coordinate.voidSets the Y coordinate.toString()Converts the value of the current Legend object to its equivalent string representation.
-
Constructor Details
-
Legend
public Legend()Initializes a new instance of the Legend class.
-
-
Method Details
-
getContentElements
Returns all content elements.- Specified by:
getContentElementsin interfaceIContentElement- Returns:
- A collection of content elements.
-
getParent
Returns the parent content element.- Specified by:
getParentin interfaceIContentElement- Returns:
- the parent
-
setParent
Sets the parent content element.- Specified by:
setParentin interfaceIContentElement- Parameters:
parent- the new parent
-
clone
Creates a new object that is a deep copy of the current instance.- Specified by:
clonein interfaceIContentElement- Overrides:
clonein classObject- Returns:
- A new object that is a copy of this instance.
-
toString
Converts the value of the current Legend object to its equivalent string representation. -
getPosition
Gets the placement of a legend.- Returns:
- the position
-
setPosition
Sets the placement of a legend.- Parameters:
position- the new position
-
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
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
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
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
Gets name that reference style mechanisms.- Returns:
- the style
-
setStyle
Sets name that reference style mechanisms.- Parameters:
style- the new style
-
getX
Gets the X coordinate.- Returns:
- the x
-
setX
Sets the X coordinate.- Parameters:
x- the new x
-
getY
Gets the Y coordinate.- Returns:
- the y
-
setY
Sets the Y coordinate.- Parameters:
y- the new y
-