title | keywords | f1_keywords | ms.service | ms.assetid | ms.date | ms.localizationpriority | |
---|---|---|---|---|---|---|---|
Chart.Legend property (Project) |
vbapj.chm131629 |
|
project-server |
38c3332c-6087-4f7b-5c02-31cba5c6933f |
06/08/2017 |
medium |
Gets an Office.IMsoLegend object that represents the legend for a chart. Read-only IMsoLegend.
expression.Legend
expression A variable that represents a Chart object.
The following example turns on the legend for the chart, and then sets the top of the legend 20 points lower than it was set previously.
Sub SetLegendTop()
Dim chartShape As Shape
Dim reportName As String
Dim legendTop As Double
reportName = "Simple scalar chart"
Set chartShape = ActiveProject.Reports(reportName).Shapes(1)
chartShape.Chart.HasLegend = True
legendTop = chartShape.Chart.Legend.Top
chartShape.Chart.Legend.Top = legendTop + 20
End Sub
IMSOLEGEND
[!includeSupport and feedback]