Example: ChartObjects property

This example displays the count of chart object of a sheet.

try {
  Application application = Application.getInstance();
  Spreadsheets spreadsheets = application.getSpreadsheets();
  Spreadsheet spreadsheet = spreadsheets.openSpreadsheet("D:\\test.ods", true);
  Sheets sheets = spreadsheet.getSheets();
  Sheet sheet = sheets.item(1);
  ChartObjects chartObjects = sheet.getChartObjects();
  System.out.println(chartObjects.getCount());
} catch(Exception e) {
  e.printStackTrace();
}

Related information

ChartObjects property