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” );
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also