ChartSheet.LineGroups 方法

在二维图表上返回一个对象,该对象表示单个折线图组(ChartGroup 对象)或折线图组的集合(ChartGroups 集合)。

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

语法

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

参数

返回值

类型:System.Object

备注

可选参数

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

示例

下面的代码示例使用 LineGroups 方法向当前 Microsoft.Office.Tools.Excel.ChartSheet 添加垂直线。

Private Sub UseLineGroups()
    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.xlLine

    Dim group As Excel.ChartGroup = _
        CType(Me.LineGroups(1), Excel.ChartGroup)
    group.HasDropLines = True
End Sub
private void UseLineGroups()
{
    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.xlLine;

    Excel.ChartGroup group =
        (Excel.ChartGroup)this.LineGroups(1);
    group.HasDropLines = true;
}

.NET Framework 安全性

请参见

参考

ChartSheet 接口

Microsoft.Office.Tools.Excel 命名空间