Aspose.Cells - Create Pivot Charts

// Instantiating an Workbook object
Workbook workbook = new Workbook("data/AsposePivotTable.xls");

// Adding a new sheet
int sheetIndex = workbook.getWorksheets().add(SheetType.CHART);
Worksheet sheet3 = workbook.getWorksheets().get(sheetIndex);

// Naming the sheet
sheet3.setName("PivotChart");

// Adding a column chart
int chartIndex = sheet3.getCharts().add(ChartType.COLUMN, 0, 5, 28, 16);
Chart chart = sheet3.getCharts().get(chartIndex);

// Setting the pivot chart data source
chart.setPivotSource("PivotTable!PivotTable1");
chart.setHidePivotFieldButtons(false);


Download Source Code

For More Examples, visit Aspose Docs

Last edited Aug 11, 2014 at 12:38 PM by shoaibkhan, version 1