Método ChartSheet.ApplyDataLabels

Aplica rótulos de dados para um ponto, uma série ou todas as séries em um Microsoft.Office.Tools.Excel.ChartSheet.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (em Microsoft.Office.Tools.Excel.dll)

Sintaxe

'Declaração
Sub ApplyDataLabels ( _
    Type As XlDataLabelsType, _
    LegendKey As Object, _
    AutoText As Object, _
    HasLeaderLines As Object, _
    ShowSeriesName As Object, _
    ShowCategoryName As Object, _
    ShowValue As Object, _
    ShowPercentage As Object, _
    ShowBubbleSize As Object, _
    Separator As Object _
)
void ApplyDataLabels(
    XlDataLabelsType Type,
    Object LegendKey,
    Object AutoText,
    Object HasLeaderLines,
    Object ShowSeriesName,
    Object ShowCategoryName,
    Object ShowValue,
    Object ShowPercentage,
    Object ShowBubbleSize,
    Object Separator
)

Parâmetros

  • LegendKey
    Tipo: System.Object
    true para mostrar o código da legenda próxima ao ponto.O valor padrão é false.
  • AutoText
    Tipo: System.Object
    true Se o objeto gera automaticamente o texto apropriado com base no conteúdo.
  • ShowSeriesName
    Tipo: System.Object
    O nome da série para o rótulo de dados.
  • ShowCategoryName
    Tipo: System.Object
    O nome de categoria para o rótulo de dados.
  • ShowPercentage
    Tipo: System.Object
    A porcentagem para o rótulo de dados.
  • ShowBubbleSize
    Tipo: System.Object
    O tamanho da bolha para o rótulo de dados.

Comentários

Optional Parameters

Para obter informações sobre os parâmetros opcionais, consulte Parâmetros opcionais em soluções do Office.

Exemplos

O seguinte exemplo de código usa a ApplyDataLabels método para mostrar os valores de dados no atual Microsoft.Office.Tools.Excel.ChartSheet.

Private Sub ShowDataLabels()
    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.ApplyDataLabels(Excel.XlDataLabelsType.xlDataLabelsShowValue, _
        AutoText:=True, HasLeaderLines:=False, ShowSeriesName:=False, _
        ShowCategoryName:=True, ShowValue:=True, ShowPercentage:=False, _
        ShowBubbleSize:=True)
End Sub
private void ShowDataLabels()
{
    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.ApplyDataLabels(
        Excel.XlDataLabelsType.xlDataLabelsShowValue,
        missing, true, false, false, true, true, false, 
        true, missing);
}

Segurança do .NET Framework

Consulte também

Referência

ChartSheet Interface

Namespace Microsoft.Office.Tools.Excel