aspose.cells

Class ChartCollection

Encapsulates a collection of Chart objects.

Example:

$workbook = new cells\Workbook();
$charts = $workbook->getWorksheets()->get(0)->getCharts();

Property Getters/Setters Summary
functiongetCount()
functionget(index)
Gets the Chart element at the specified index.
functionget(name)
Gets the chart by the name.
 
Method Summary
functionadd(data, dataRange, isVertical, topRow, leftColumn, rightRow, bottomColumn)
Adds a chart with preset template.
functionadd(type, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn)
Adds a chart to the collection.
functionadd(type, dataRange, isVertical, topRow, leftColumn, rightRow, bottomColumn)
Adds a chart to the collection.
functionadd(type, dataRange, topRow, leftColumn, rightRow, bottomColumn)
Adds a chart to the collection.
functionadd(value)
Reserved for internal use.
functionaddFloatingChart(type, left, top, width, height)
Adds a chart to the collection.
functionclear()
Clear all charts.
functioncontains(value)
Reserved for internal use.
functionget(index)
Reserved for internal use.
functionindexOf(value)
Reserved for internal use.
functioniterator()
functionremove(chart)
Remove the specific chart.
functionremoveAt(index)
Remove a chart at the specific index.
 

    • Property Getters/Setters Detail

      • getCount : Number 

        function getCount()
        
      • get : Chart 

        function get(index)
        
        Gets the Chart element at the specified index.
        Parameters:
        index - The zero based index of the element.
        Returns:
        The element at the specified index.
      • get : Chart 

        function get(name)
        
        Gets the chart by the name. The default chart name is null. So you have to explicitly set the name of the chart.
        Parameters:
        name - The chart name.
        Returns:
        The chart.
    • Method Detail

      • addFloatingChart

        function addFloatingChart(type, left, top, width, height)
        Adds a chart to the collection.
        Parameters:
        type: Number - A ChartType value. Chart type
        left: Number - The x offset to corner
        top: Number - The y offset to corner
        width: Number - The chart width
        height: Number - The chart height
        Returns:
        Chart object index.
      • add

        function add(type, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn)
        Adds a chart to the collection.
        Parameters:
        type: Number - A ChartType value. Chart type
        upperLeftRow: Number - Upper left row index.
        upperLeftColumn: Number - Upper left column index.
        lowerRightRow: Number - Lower right row index
        lowerRightColumn: Number - Lower right column index
        Returns:
        Chart object index.
      • add

        function add(type, dataRange, topRow, leftColumn, rightRow, bottomColumn)
        Adds a chart to the collection. NOTE: This member is now obsolete. Instead, please use add(int, java.lang.String, boolean, int, int, int, int) property. This property will be removed 12 months later since May 2022. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        type: Number - A ChartType value. Chart type
        dataRange: String - Specifies the data range of the chart
        topRow: Number - Upper left row index.
        leftColumn: Number - Upper left column index.
        rightRow: Number - Lower right row index
        bottomColumn: Number - Lower right column index
        Returns:
        Chart object index.
      • add

        function add(data, dataRange, isVertical, topRow, leftColumn, rightRow, bottomColumn)
        Adds a chart with preset template.
        Parameters:
        data: byte[] - The data of chart template file(.crtx).
        dataRange: String - Specifies the data range of the chart
        isVertical: boolean - Specifies whether to plot the series from a range of cell values by row or by column.
        topRow: Number - Upper left row index.
        leftColumn: Number - Upper left column index.
        rightRow: Number - Lower right row index
        bottomColumn: Number - Lower right column index
        Returns:
        Chart object index.
      • add

        function add(type, dataRange, isVertical, topRow, leftColumn, rightRow, bottomColumn)
        Adds a chart to the collection.
        Parameters:
        type: Number - A ChartType value. Chart type
        dataRange: String - Specifies the data range of the chart
        isVertical: boolean - Specifies whether to plot the series from a range of cell values by row or by column.
        topRow: Number - Upper left row index.
        leftColumn: Number - Upper left column index.
        rightRow: Number - Lower right row index
        bottomColumn: Number - Lower right column index
        Returns:
        Chart object index.
      • remove

        function remove(chart)
        Remove the specific chart.
        Parameters:
        chart: Chart -
      • removeAt

        function removeAt(index)
        Remove a chart at the specific index.
        Parameters:
        index: Number - The chart index.
      • clear

        function clear()
        Clear all charts.
      • iterator

        function iterator()
      • get

        function get(index)
        Reserved for internal use.
      • contains

        function contains(value)
        Reserved for internal use.
      • add

        function add(value)
        Reserved for internal use.
      • indexOf

        function indexOf(value)
        Reserved for internal use.