Skip to main content

LegendBase Class

The base class for chart legends.

Declaration

public abstract class LegendBase extends ChartElement

Remarks

Call the Chart.getLegend() method to access the legend of a chart. To specify the legend background and border, call LegendBase.setFill(value) and LegendBase.setOutlineStyle(value) methods.

The LegendEx class derives from the LegendBase class and contains legend settings for chart types introduced in Microsoft Excel 2016.

Refer to the following help topic for additional information: Customize Chart Legends — Presentation API for Java.

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

See Also

Methods

deepClone() Method

Returns a deep copy of this LegendBase instance.

Declaration

public LegendBase deepClone()

Returns

Type Description
LegendBase

A deep copy of this LegendBase.

getAllowOverlapChart() Method

Returns whether the legend can overlap the plot area.

Declaration

public boolean getAllowOverlapChart()

Returns

Type Description
boolean

true if the legend can overlap the plot area; otherwise, false.

getPosition() Method

Returns the legend position in the chart.

Declaration

public LegendPositionType getPosition()

Returns

Type Description
LegendPositionType

The legend position.

getTextProperties() Method

Returns text formatting settings of the legend.

Declaration

public TextProperties getTextProperties()

Returns

Type Description
TextProperties

Text formatting settings of the legend, or null if the legend does not specify text formatting settings.

setAllowOverlapChart(boolean value) Method

Sets whether the legend can overlap the plot area.

Declaration

public void setAllowOverlapChart(boolean value)

Parameters

Name Type Description
value boolean

true to allow the legend to overlap the plot area; otherwise, false.

Remarks

If you do not call the setAllowOverlapChart(value) method, the API uses false for a new legend and the value from the document for a loaded legend.

setPosition(LegendPositionType value) Method

Sets the legend position in the chart.

Declaration

public void setPosition(LegendPositionType value)

Parameters

Name Type Description
value LegendPositionType

The legend position.

Exceptions

Type Description
NullPointerException

Thrown if the value parameter is null and the legend is in a chart on a slide.

Remarks

The setPosition(value) method accepts the following values:

Value Description
BOTTOM Indicates that the legend is at the bottom of the chart.
TOP_RIGHT Indicates that the legend is in the upper-right corner of the chart.
LEFT Indicates that the legend is on the left side of the chart.
RIGHT Indicates that the legend is on the right side of the chart.
TOP Indicates that the legend is at the top of the chart.

If you do not call the setPosition(value) method, the API uses LegendPositionType.RIGHT for a new legend and the value from the document for a loaded legend.

setTextProperties(TextProperties value) Method

Sets text formatting settings of the legend.

Declaration

public void setTextProperties(TextProperties value)

Parameters

Name Type Description
value TextProperties

Text formatting settings of the legend.