Table of contents
Collapse the table of content
Expand the table of content

Chart.Legend Property (Project)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

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

Property value


See also

Other resources

Chart Object

© 2018 Microsoft