Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / SeriesCollection Class / AddFromCells Method / AddFromCells<T>(String,String,Worksheet) Method
The type of Series that will be added to the SeriesCollection.

The Address of the first Cell in the CellRange.

This must be a valid Address.

The Address of the last Cell in the CellRange.

This must be a valid Address.

The Worksheet where the targeted Cells can be found.

When this is set to null, the Worksheet hosting the targeted SeriesCollection is used.

 

Example


In This Topic
    AddFromCells<T>(String,String,Worksheet) Method
    In This Topic
    Adds a Series of type T to the SeriesCollection & takes the Series' values from the content of a CellRange, itself identified by Addresses.
    Syntax
    'Declaration
     
    
    Public Overloads Function AddFromCells(Of T As {New, Series})( _
       ByVal startCellAddress As String, _
       ByVal endCellAddress As String, _
       Optional ByVal relatedWorksheet As Worksheet _
    ) As T
    'Usage
     
    
    Dim instance As SeriesCollection
    Dim startCellAddress As String
    Dim endCellAddress As String
    Dim relatedWorksheet As Worksheet
    Dim value As T
     
    value = instance.AddFromCells(Of T)(startCellAddress, endCellAddress, relatedWorksheet)
    public T AddFromCells<T>( 
       string startCellAddress,
       string endCellAddress,
       Worksheet relatedWorksheet
    )
    where T: new(), Series

    Parameters

    startCellAddress

    The Address of the first Cell in the CellRange.

    This must be a valid Address.

    endCellAddress

    The Address of the last Cell in the CellRange.

    This must be a valid Address.

    relatedWorksheet

    The Worksheet where the targeted Cells can be found.

    When this is set to null, the Worksheet hosting the targeted SeriesCollection is used.

     

    Type Parameters

    T
    The type of Series that will be added to the SeriesCollection.

    Return Value

    The Series of type T that has been added to the SeriesCollection.
    Remarks
    The given Addresses must correspond either to a single Cell, a single Column or a single Row.
    Example
    // Adds a PieSeries to the Pie3DChart by specifying its values from a range of Cells’ Addresses (A1 to F6 of the current Worksheet).
     var pieSeries = pie3DChart.SeriesCollection.AddFromCells<PieSeries>( “A1”, “F6” );
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also