Chart.GapDepth 属性

获取或设置三维图表中数据系列之间的距离(以标记宽度的百分比形式表示)。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel(在 Microsoft.Office.Tools.Excel.dll 中)

语法

声明
Property GapDepth As Integer
int GapDepth { get; set; }

属性值

类型:System.Int32
三维图表中数据系列之间的距离(以标记宽度的百分比形式表示)。此属性的值必须介于 0 到 500 之间。

示例

下面的代码示例创建一个三维 Chart,然后使用 GapDepth 属性将数据系列之间的距离更改为标记宽度的 300%。

Private Sub SetGapDepth()
    Me.Range("A1", "A5").Value2 = 22
    Me.Range("B1", "B5").Value2 = 55

    Dim Chart1 As Microsoft.Office.Tools.Excel.Chart = _
        Me.Controls.AddChart(Me.Range("D2", "H12"), "Chart1")

    Chart1.SetSourceData(Me.Range("A1", "B5"), Excel.XlRowCol.xlColumns)
    Chart1.ChartType = Excel.XlChartType.xl3DColumn

    Chart1.GapDepth = 300
End Sub
private void SetGapDepth()
{
    this.Range["A1", "A5"].Value2 = 22;
    this.Range["B1", "B5"].Value2 = 55;

    Microsoft.Office.Tools.Excel.Chart chart1 =
        this.Controls.AddChart(this.Range["D2", "H12"], 
        "chart1");

    chart1.SetSourceData(this.Range["A1", "B5"], 
        Excel.XlRowCol.xlColumns);
    chart1.ChartType = Excel.XlChartType.xl3DColumn;

    chart1.GapDepth = 300;
}

.NET Framework 安全性

请参见

参考

Chart 接口

Microsoft.Office.Tools.Excel 命名空间