Compartir a través de


ChartSheetBase.Legend (Propiedad)

Obtiene una propiedad Legend que representa la leyenda del objeto Microsoft.Office.Tools.Excel.ChartSheetBase.

Espacio de nombres:  Microsoft.Office.Tools.Excel
Ensamblado:  Microsoft.Office.Tools.Excel.v4.0.Utilities (en Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Sintaxis

'Declaración
Public ReadOnly Property Legend As Legend
public Legend Legend { get; }

Valor de propiedad

Tipo: Microsoft.Office.Interop.Excel.Legend
Una propiedad Legend que representa la leyenda del objeto Microsoft.Office.Tools.Excel.ChartSheetBase.

Ejemplos

El ejemplo de código siguiente utiliza la propiedad Legend para modificar el color del borde de la leyenda del objeto Microsoft.Office.Tools.Excel.ChartSheetBase actual.

Private Sub SetLegendColor()
    Globals.Sheet1.Range("A1", "A5").Value2 = 22
    Globals.Sheet1.Range("B1", "B5").Value2 = 55

    Me.SetSourceData(Globals.Sheet1.Range("A1", "B5"), _
        Excel.XlRowCol.xlColumns)
    Me.ChartType = Excel.XlChartType.xl3DBarClustered

    Me.Legend.Border.Color = _
            ColorTranslator.ToOle(Color.Green)
End Sub
private void SetLegendColor()
{
    Globals.Sheet1.Range["A1", "A5"].Value2 = 22;
    Globals.Sheet1.Range["B1", "B5"].Value2 = 55;

    this.SetSourceData(Globals.Sheet1.Range["A1", "B5"],
        Excel.XlRowCol.xlColumns);
    this.ChartType = Excel.XlChartType.xl3DBarClustered;

    this.Legend.Border.Color =
        ColorTranslator.ToOle(Color.Green);
}

Seguridad de .NET Framework

Vea también

Referencia

ChartSheetBase Clase

Microsoft.Office.Tools.Excel (Espacio de nombres)