Partager via


ChartSheet.ChartStyle, propriété

Obtient ou définit le style du graphique.

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
Property ChartStyle As Object
Object ChartStyle { get; set; }

Valeur de propriété

Type : System.Object
Entier compris entre 1 et 48 qui représente le style du graphique.

Notes

Les valeurs de la propriété ChartStyle correspondent aux options disponibles dans le groupe Styles du graphique sous l'onglet Création sur le ruban. L'onglet Création est disponible lorsque vous sélectionnez un graphique.

Exemples

L'exemple de code suivant spécifie les couleurs des murs et sol d'une feuille de graphique 3D existante et définit le style de graphique à style 4. Pour exécuter cet exemple de code, le classeur doit contenir une feuille de graphique appelée Chart1 d'un type 3D.

Private Sub SetChartSheetDesign()
    ' Add a new chart and populate source data
    Dim myChartSheet As Microsoft.Office.Tools.Excel.ChartSheet = _
        Globals.Chart1.Base

    myChartSheet.BackWall.Format.Fill.ForeColor.RGB = _
        System.Drawing.Color.LightGray.ToArgb()
    myChartSheet.SideWall.Format.Fill.ForeColor.RGB = _
        System.Drawing.Color.LightGray.ToArgb()
    myChartSheet.Floor.Format.Fill.ForeColor.RGB = _
        System.Drawing.Color.Gray.ToArgb()

    myChartSheet.ChartStyle = 4
End Sub
private void SetChartSheetDesign()
{
    // Add a new chart and populate source data
    Microsoft.Office.Tools.Excel.ChartSheet myChartSheet =
        Globals.Chart1.Base;

    myChartSheet.BackWall.Format.Fill.ForeColor.RGB =
        System.Drawing.Color.LightGray.ToArgb();
    myChartSheet.SideWall.Format.Fill.ForeColor.RGB =
        System.Drawing.Color.LightGray.ToArgb();
    myChartSheet.Floor.Format.Fill.ForeColor.RGB =
        System.Drawing.Color.Gray.ToArgb();

    myChartSheet.ChartStyle = 4;
}

Sécurité .NET Framework

Voir aussi

Référence

ChartSheet Interface

Microsoft.Office.Tools.Excel, espace de noms