편집

다음을 통해 공유


LegendEntry Interface

Definition

Represents a legend entry in a chart legend.

public interface class LegendEntry
[System.Runtime.InteropServices.Guid("C4A02049-024C-4273-8934-E48CC21479A9")]
public interface LegendEntry
type LegendEntry = interface
Public Interface LegendEntry
Attributes

Examples

Use LegendEntries(index), where index is the legend entry index number, to return a single LegendEntry object. You cannot return legend entries by name.

The index number represents the position of the legend entry in the legend. LegendEntries(1) is at the top of the legend, and LegendEntries(LegendEntries.Count) is at the bottom.

Remarks

The LegendEntry object is a member of the LegendEntries collection. The LegendEntries collection contains all the LegendEntry objects in the legend.

Each legend entry has two parts: the text of the entry, which is the name of the series associated with the legend entry; and an entry marker, which visually links the legend entry with its associated series or trendline in the chart. Formatting properties for the entry marker and its associated series or trendline are contained in the LegendKey object.

The text of a legend entry cannot be changed. LegendEntry objects support font formatting, and they can be deleted. No pattern formatting is supported for legend entries. The position and size of entries is fixed.

There’s no direct way to return the series or trendline corresponding to the legend entry.

After legend entries have been deleted, the only way to restore them is to remove and recreate the legend that contained them by setting the HasLegend property for the chart to False and then back to True.

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.

Creator

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

Font

Returns a ChartFont 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 a Double value that represents the height, in points, of the object.

Index

Returns the index number of the object within the collection of similar objects.

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.

LegendKey

Returns a LegendKey object that represents the legend key associated with the entry.

Parent

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

Top

Returns 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 a Double value that represents the width, in points, of the object.

Methods

Delete()

Deletes the object.

Select()

Selects the object.

Applies to