Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 1.14 KB

Project.chart.legend.md

File metadata and controls

54 lines (34 loc) · 1.14 KB
title keywords f1_keywords ms.service ms.assetid ms.date ms.localizationpriority
Chart.Legend property (Project)
vbapj.chm131629
vbapj.chm131629
project-server
38c3332c-6087-4f7b-5c02-31cba5c6933f
06/08/2017
medium

Chart.Legend property (Project)

Gets an Office.IMsoLegend object that represents the legend for a chart. Read-only IMsoLegend.

Syntax

expression.Legend

expression A variable that represents a Chart object.

Example

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

IMSOLEGEND

See also

Chart Object

[!includeSupport and feedback]