Edit

Share via


Legend Interface

Definition

Represents the legend in a chart. Each chart can have only one legend.

public interface class Legend
[System.Runtime.InteropServices.Guid("B3A1E8C6-E1CE-4A46-8D12-E017157B03D7")]
public interface Legend
type Legend = interface
Public Interface Legend
Attributes

Examples

Use the Legend property to return the Legend object. The following example sets the font style for the legend of the first chart in the active document to bold.

Remarks

The Legend object contains one or more LegendEntry objects; each LegendEntry object contains a LegendKey object.

The chart legend isn’t visible unless the HasLegend property is True. If this property is False, properties and methods of the Legend object will fail.

Properties

Application

When used without an object qualifier, this property returns an _Application object that represents the Microsoft Word application. When used with an object qualifier, this property returns an Application object that represents the creator of the specified object (you can use this property with an OLE Automation object to return the application of that object). Read-only.

AutoScaleFont

True if the text in the object changes font size when the object size changes. The default value is True.

Border

Returns a Border object that represents the border of the object.

Creator

Returns a 32-bit integer that indicates the application in which the specified object was created. Read-only Integer.

Fill

Returns a FillFormat object for a specified shape or a ChartFillFormat object for a specified chart that contains fill formatting properties for the shape or chart.

Font

Returns a Font object that represents the font of the specified object.

Format

Returns the line, fill, and effect formatting for the object. Read-only ChartFormat.

Height

Returns or sets a Double value that represents the height, in points, of the object.

IncludeInLayout

Set to True if a legend will occupy the chart layout space when a chart layout is being determined. The default value is True. Read/write Boolean.

Interior

Returns an Interior object that represents the interior of the specified object.

Left

Returns a Double value that represents the distance, in points, from the left edge of the object to the left edge of the chart area.

Name

Returns a String value that represents the name of the object.

Parent

Returns the parent for the specified object. Read-only Object.

Position

Returns or sets a XlLegendPosition value that represents the position of the legend on the chart.

Shadow

Returns or sets a Boolean value that determines if the object has a shadow.

Top

Returns or sets a Double value that represents the distance, in points, from the top edge of the object to the top of row 1 (on a worksheet) or the top of the chart area (on a chart).

Width

Returns or sets a Double value that represents the width, in points, of the object.

Methods

Clear()

Clears the entire object.

Delete()

Deletes the object.

LegendEntries(Object)

Returns a LegendEntries object that represents the legend entries for the legend.

Select()

Selects the object.

Applies to