Legend Property

Microsoft Office Web Components Visual Basic

object that represents the legend for the specified chart.

expression.Legend

expression    Required. An expression that returns a ChChart object.

Example

This example causes the specified chart to display its legend and then sets the legend font.

Sub AddLegend()

   ' Enable the legend for the first chart in Chartspace1.
   ChartSpace1.Charts(0).HasLegend = True

   ' Set the font for the legend.
   ChartSpace1.Charts(0).Legend.Font.Name = "Times New Roman"

End Sub