Partager via


ChartSheet.ChartGroups, méthode

Obtient un objet qui représente un seul groupe de graphiques (objet ChartGroup) ou une collection de tous les groupes de graphiques dans le graphique (objet ChartGroups).

Espace de noms :  Microsoft.Office.Tools.Excel
Assemblys :   Microsoft.Office.Tools.Excel.v4.0.Utilities (dans Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
  Microsoft.Office.Tools.Excel (dans Microsoft.Office.Tools.Excel.dll)

Syntaxe

'Déclaration
Function ChartGroups ( _
    Index As Object _
) As Object
Object ChartGroups(
    Object Index
)

Paramètres

Valeur de retour

Type : System.Object

Notes

La collection retournée inclut chaque type de groupe.

Paramètres optionnels

Pour plus d'informations sur les paramètres optionnels, consultez Paramètres optionnels dans les solutions Office.

Exemples

L'exemple de code suivant utilise la méthode ChartGroups pour définir la distance entre les barres du Microsoft.Office.Tools.Excel.ChartSheet actuel.

Private Sub UseChartGroups()
    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.xlBarClustered

    Dim Group1 As Excel.ChartGroup = _
        CType(Me.ChartGroups(1), Excel.ChartGroup)
    Group1.GapWidth = 400
End Sub
private void UseChartGroups()
{
    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.xlBarClustered;

    Excel.ChartGroup group =
        (Excel.ChartGroup)this.ChartGroups(1);
    group.GapWidth = 400;
}

Sécurité .NET Framework

Voir aussi

Référence

ChartSheet Interface

Microsoft.Office.Tools.Excel, espace de noms