Chart.SideWall, propriété (System 2007)

Mise à jour : novembre 2007

Obtient un objet qui représente le mur latéral d'un graphique 3D.

Espace de noms :  Microsoft.Office.Tools.Excel
Assembly :  Microsoft.Office.Tools.Excel.v9.0 (dans Microsoft.Office.Tools.Excel.v9.0.dll)

Syntaxe

Public ReadOnly Property SideWall As Walls

Dim instance As Chart
Dim value As Walls

value = instance.SideWall
public Walls SideWall { get; }

Valeur de propriété

Type : Microsoft.Office.Interop.Excel.Walls

Objet Microsoft.Office.Interop.Excel.Walls qui représente le mur latéral d'un graphique 3D.

Notes

Utilisez la propriété SideWall pour mettre en forme le mur latéral d'un graphique 3D.

Exemples

L'exemple de code suivant ajoute un histogramme 3D groupé à Sheet1 et lui affecte le style 4. Il crée ensuite une plage de données arbitraires et les définit comme données sources du graphique. Ensuite, le code spécifie les couleurs des parois et du plancher du graphique.

Private Sub SetChartBackWalls()
    ' Add a new chart and populate source data
    Dim myNewChart As Microsoft.Office.Tools.Excel.Chart = _
    Globals.Sheet1.Controls.AddChart( _
        Globals.Sheet1.Range("D5", "J16"), "myNewChart")
    myNewChart.ChartType = Excel.XlChartType.xl3DColumnClustered
    ' Set chart style
    myNewChart.ChartStyle = 4

    Globals.Sheet1.Range("A1").Value2 = "Product"
    Globals.Sheet1.Range("B1").Value2 = "Units Sold"
    Dim i As Integer
    For i = 1 To 3
        Globals.Sheet1.Range("A" + (i + 1).ToString()).Value2 = _
            "Product" + i.ToString()
        Globals.Sheet1.Range("B" + (i + 1).ToString()).Value2 = i * 10
    Next
    Dim data As Excel.Range = Globals.Sheet1.Range("A1", "B4")
    myNewChart.SetSourceData(data)

    ' Set foreground color for 3D chart walls and floor
    myNewChart.BackWall.Format.Fill.ForeColor.RGB = _
        System.Drawing.Color.LightGray.ToArgb()
    myNewChart.SideWall.Format.Fill.ForeColor.RGB = _
        System.Drawing.Color.LightGray.ToArgb()
    myNewChart.Floor.Format.Fill.ForeColor.RGB = _
        System.Drawing.Color.Gray.ToArgb()
End Sub
private void SetChartBackWalls()
{
    // Add a new chart and populate source data
    Microsoft.Office.Tools.Excel.Chart myNewChart =
    Globals.Sheet1.Controls.AddChart(
        Globals.Sheet1.Range["D5", "J16"], "myNewChart");
    myNewChart.ChartType = Excel.XlChartType.xl3DColumnClustered;
    // Set chart style
    myNewChart.ChartStyle = 4;

    Globals.Sheet1.Range["A1",missing].Value2 = "Product";
    Globals.Sheet1.Range["B1",missing].Value2 = "Units Sold";

    for (int i=1; i<4; i++)
    {
        Globals.Sheet1.Range["A" + (i + 1).ToString(),missing].Value2 =
            "Product" + i.ToString();
        Globals.Sheet1.Range["B" + (i + 1).ToString(),missing].Value2 = 
            i * 10;
    }
    Excel.Range data = Globals.Sheet1.Range["A1", "B4"];
    myNewChart.SetSourceData(data,missing);

    // Set foreground color for 3D chart walls and floor
    myNewChart.BackWall.Format.Fill.ForeColor.RGB =
        System.Drawing.Color.LightGray.ToArgb();
    myNewChart.SideWall.Format.Fill.ForeColor.RGB =
        System.Drawing.Color.LightGray.ToArgb();
    myNewChart.Floor.Format.Fill.ForeColor.RGB = 
        System.Drawing.Color.Gray.ToArgb();        
}

Autorisations

Voir aussi

Référence

Chart, classe

Membres Chart

Microsoft.Office.Tools.Excel, espace de noms