The Legend Key Object

A legend key is represented by a LegendKey object. This object has Border, ChartFillFormat, and Interior children.

It is very important to note that formatting the LegendKey object will also automatically format the actual series that the legend entry represents. In other words, the series and its legend key always match.

Thus, for instance, the following code formats the first data series and its legend key with a red interior and a thick border:

With ActiveChart.Legend.LegendEntries(1).LegendKey .Interior.ColorIndex = 3 .Border.Weight = xlThick End With

0 0

Post a comment