Edit

Share via


HasLegend property (Excel Graph)

True if the chart has a legend. Read/write Boolean.

Syntax

expression.HasLegend

expression Required. An expression that returns one of the objects in the Applies To list.

Example

This example turns on the legend for the chart, and then sets the legend font color to blue.

With myChart 
 .HasLegend = True 
 .Legend.Font.ColorIndex = 5 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.