LegendKey Object

Description

Represents a legend key in a chart legend. Each legend key is a graphic that visually links a legend entry with its associated series or trendline in the chart. The legend key is linked to its associated series or trendline in such a way that changing the formatting of one simultaneously changes the formatting of the other.

Using the LegendKey Object

Use the LegendKey property to return the LegendKey object. The following example changes the marker background color for the legend entry at the top of the legend for embedded chart one on the worksheet named "Sheet1." This simultaneously changes the format of every point in the series associated with this legend entry. The associated series must support data markers.

Worksheets("Sheet1").ChartObjects(1).Chart _
    .Legend.LegendEntries(1).LegendKey.MarkerBackgroundColorIndex = 5
Properties

Application property, Border property, Creator property, Fill property, Height property, Interior property, InvertIfNegative property, Left property, MarkerBackgroundColor property, MarkerBackgroundColorIndex property, MarkerForegroundColor property, MarkerForegroundColorIndex property, MarkerSize property, MarkerStyle property, Parent property, PictureType property, PictureUnit property, Shadow property, Smooth property, Top property, Width property.

Methods

ClearFormats method, Delete method, Select method.