ChartSheetBase.ChartGroups(Object) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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).
public object ChartGroups (object index);
Paramètres
- index
- Object
Nombre de groupes de graphiques.
Retours
Exemples
L’exemple de code suivant utilise la ChartGroups méthode pour définir la distance entre les barres du en cours Microsoft.Office.Tools.Excel.ChartSheetBase .
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;
}
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
Remarques
La collection retournée inclut chaque type de groupe.
Paramètres facultatifs
Pour plus d’informations sur les paramètres facultatifs, consultez paramètres facultatifs dans les solutions Office.