ChartSheet.PieGroups 方法

在二维 Microsoft.Office.Tools.Excel.ChartSheet 上返回一个对象,该对象表示单个饼图组(ChartGroup 对象)或饼图组的集合(ChartGroups 集合)。

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

语法

声明
Function PieGroups ( _
    Index As Object _
) As Object
Object PieGroups(
    Object Index
)

参数

返回值

类型:System.Object

备注

可选参数

有关可选参数的信息,请参见Office 解决方案中的可选参数

示例

下面的代码示例使用 PieGroups 方法设置当前 Microsoft.Office.Tools.Excel.ChartSheet 中的第一个扇面的起始角度。

Private Sub UsePieGroups()
    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.xlPie

    Dim group As Excel.ChartGroup = _
        CType(Me.PieGroups(1), Excel.ChartGroup)
    group.FirstSliceAngle = 90
End Sub
private void UsePieGroups()
{
    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.xlPie;

    Excel.ChartGroup group =
        (Excel.ChartGroup)this.PieGroups(1);
    group.FirstSliceAngle = 90;
}

.NET Framework 安全性

请参见

参考

ChartSheet 接口

Microsoft.Office.Tools.Excel 命名空间