Package org.apache.poi.ss.util

Examples of org.apache.poi.ss.util.SheetBuilder


            {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    };

    public void testOneSeriePlot() throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, plotData).build();
        Drawing drawing = sheet.createDrawingPatriarch();
        ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 1, 1, 10, 30);
        Chart chart = drawing.createChart(anchor);

        ChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
View Full Code Here


        assertDataSourceIsEqualToArray(stringDataSource, strings);
    }

    public void testNumericCellDataSource() {
        Workbook wb = new HSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, numericCells).build();
        CellRangeAddress numCellRange = CellRangeAddress.valueOf("A2:E2");
        ChartDataSource<Number> numDataSource = DataSources.fromNumericCellRange(sheet, numCellRange);
        assertTrue(numDataSource.isReference());
        assertTrue(numDataSource.isNumeric());
        assertEquals(numericCells[0].length, numDataSource.getPointCount());
View Full Code Here

        }
    }

    public void testStringCellDataSource() {
        Workbook wb = new HSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, stringCells).build();
        CellRangeAddress numCellRange = CellRangeAddress.valueOf("A2:E2");
        ChartDataSource<String> numDataSource = DataSources.fromStringCellRange(sheet, numCellRange);
        assertTrue(numDataSource.isReference());
        assertFalse(numDataSource.isNumeric());
        assertEquals(numericCells[0].length, numDataSource.getPointCount());
View Full Code Here

        }
    }

    public void testMixedCellDataSource() {
        Workbook wb = new HSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, mixedCells).build();
        CellRangeAddress mixedCellRange = CellRangeAddress.valueOf("A1:F1");
        ChartDataSource<String> strDataSource = DataSources.fromStringCellRange(sheet, mixedCellRange);
        ChartDataSource<Number> numDataSource = DataSources.fromNumericCellRange(sheet, mixedCellRange);
        for (int i = 0; i < mixedCells[0].length; ++i) {
            if (i % 2 == 0) {
View Full Code Here

        }
    }

    public void testIOBExceptionOnInvalidIndex() {
        Workbook wb = new HSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, numericCells).build();
        CellRangeAddress rangeAddress = CellRangeAddress.valueOf("A2:E2");
        ChartDataSource<Number> numDataSource = DataSources.fromNumericCellRange(sheet, rangeAddress);
        IndexOutOfBoundsException exception = null;
        try {
            numDataSource.getPointAt(-1);
View Full Code Here

            1,    2,   3,    4,    5,   6,    7,   8,    910}
    };

    public void testOneSeriePlot() throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, plotData).build();
        Drawing drawing = sheet.createDrawingPatriarch();
        ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 1, 1, 10, 30);
        Chart chart = drawing.createChart(anchor);

        ChartAxis bottomAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.BOTTOM);
View Full Code Here

            1,    2,   3,    4,    5,   6,    7,   8,    910}
    };

    public void testOneSeriePlot() throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, plotData).build();
        Drawing drawing = sheet.createDrawingPatriarch();
        ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 1, 1, 10, 30);
        Chart chart = drawing.createChart(anchor);

        ChartAxis bottomAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.BOTTOM);
View Full Code Here

            {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    };

    public void testOneSeriePlot() throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = new SheetBuilder(wb, plotData).build();
        Drawing drawing = sheet.createDrawingPatriarch();
        ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 1, 1, 10, 30);
        Chart chart = drawing.createChart(anchor);

        ChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
View Full Code Here

    private CountCellHandler countCellHandler = new CountCellHandler();

    public void testNotTraverseEmptyCells() {
  Workbook wb = new HSSFWorkbook();
  Sheet sheet = new SheetBuilder(wb, testData).build();
  CellRangeAddress range = CellRangeAddress.valueOf("A1:C3");
 
  CellWalk cellWalk = new CellWalk(sheet, range);
  countCellHandler.reset();
  cellWalk.traverse(countCellHandler);
View Full Code Here

  {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    };
   
    public void testOneSeriePlot() throws Exception {
  Workbook wb = new XSSFWorkbook();
  Sheet sheet = new SheetBuilder(wb, plotData).build();
  Drawing drawing = sheet.createDrawingPatriarch();
  ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 1, 1, 10, 30);
  Chart chart = drawing.createChart(anchor);

  ChartAxis bottomAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.BOTTOM);
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.util.SheetBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.