com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class ChartDataWorkbook

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void calculateFormulas()
      Calculates all formulas in the workbook and updates corresponding cells values.
      void clear(int sheetIndex)
      Clear all cells values on sheet
      IChartDataCell getCell(int worksheetIndex, int row, int column)
      Gets the cell that can be used for chart series or categories
      IChartDataCell getCell(int worksheetIndex, int row, int column, java.lang.Object value)
      Gets the cell that can be used for chart series or categories
      IChartDataCell getCell(int worksheetIndex, java.lang.String cellName)
      Gets the cell that can be used for chart series or categories
      IChartDataCell getCell(int worksheetIndex, java.lang.String cellName, java.lang.Object value)
      Gets the cell that can be used for chart series or categories
      IChartDataCell getCell(java.lang.String worksheetName, int row, int column)
      Gets the cell that can be used for chart series or categories
      IChartCellCollection getCellCollection(java.lang.String formula, boolean skipHiddenCells)
      Gets the set of cells.
      IChartDataWorksheetCollection getWorksheets()
      Gets a collection of worksheets.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getWorksheets

        public final IChartDataWorksheetCollection getWorksheets()

        Gets a collection of worksheets.


         Example:
         
         Presentation pres = new Presentation();
         try {
             IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 400, 500);
             IChartDataWorkbook workbook =  chart.getChartData().getChartDataWorkbook();
             for (IChartDataWorksheet worksheet : workbook.getWorksheets())
             {
                 String worksheetName = worksheet.getName();
             }
         } finally {
             if (pres != null) pres.dispose();
         }
         
        Specified by:
        getWorksheets in interface IChartDataWorkbook
      • getCellCollection

        public final IChartCellCollection getCellCollection(java.lang.String formula,
                                                            boolean skipHiddenCells)

        Gets the set of cells.

        Specified by:
        getCellCollection in interface IChartDataWorkbook
        Parameters:
        formula - Excel formula like "Sheet1!$A$2:$A$5".
        skipHiddenCells - If true then method returns collection without hidden cells.
        Returns:
        Set of cells IChartCellCollection
      • getCell

        public final IChartDataCell getCell(java.lang.String worksheetName,
                                            int row,
                                            int column)

        Gets the cell that can be used for chart series or categories

        Specified by:
        getCell in interface IChartDataWorkbook
        Parameters:
        worksheetName - Name of the worksheet.
        row - The row.
        column - The column.
        Returns:
        Cell object
      • getCell

        public final IChartDataCell getCell(int worksheetIndex,
                                            int row,
                                            int column)

        Gets the cell that can be used for chart series or categories

        Specified by:
        getCell in interface IChartDataWorkbook
        Parameters:
        worksheetIndex - Index of the worksheet.
        row - The row.
        column - The column.
        Returns:
        Cell object
      • getCell

        public final IChartDataCell getCell(int worksheetIndex,
                                            java.lang.String cellName)

        Gets the cell that can be used for chart series or categories

        Specified by:
        getCell in interface IChartDataWorkbook
        Parameters:
        worksheetIndex - Index of the worksheet.
        cellName - Name of the cell.
        Returns:
        Cell object
      • getCell

        public final IChartDataCell getCell(int worksheetIndex,
                                            java.lang.String cellName,
                                            java.lang.Object value)

        Gets the cell that can be used for chart series or categories

        Specified by:
        getCell in interface IChartDataWorkbook
        Parameters:
        worksheetIndex - Index of the worksheet.
        cellName - Name of the cell.
        value - The value.
        Returns:
        Cell object
      • getCell

        public final IChartDataCell getCell(int worksheetIndex,
                                            int row,
                                            int column,
                                            java.lang.Object value)

        Gets the cell that can be used for chart series or categories

        Specified by:
        getCell in interface IChartDataWorkbook
        Parameters:
        worksheetIndex - Index of the worksheet.
        row - The row.
        column - The column.
        value - The value.
        Returns:
        Cell object
      • clear

        public final void clear(int sheetIndex)

        Clear all cells values on sheet

        Specified by:
        clear in interface IChartDataWorkbook
        Parameters:
        sheetIndex - Index of sheet
      • calculateFormulas

        public final void calculateFormulas()

        Calculates all formulas in the workbook and updates corresponding cells values.


          Example shows how to assign a formula to the cell and to calculate a value. The value of the "B4" cell is getting set to 5.
          
          Presentation pres = new Presentation();
          try {
              IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 100, 100, 300, 400);
              IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook();
              wb.getCell(0, "B2", 2);
              wb.getCell(0, "B3", 3);
              wb.getCell(0, "B4").setFormula("B2+B3");
              wb.calculateFormulas();
              ...
          } finally {
              if (pres != null) pres.dispose();
          }
          
        Specified by:
        calculateFormulas in interface IChartDataWorkbook
        Throws:
        CellCircularReferenceException - Workbook contains formulas with a circular reference.
        CellUnsupportedDataException - Cell data is not supported.