Example usage for org.apache.poi.hssf.usermodel HSSFChart getSheetCharts

List of usage examples for org.apache.poi.hssf.usermodel HSSFChart getSheetCharts

Introduction

In this page you can find the example usage for org.apache.poi.hssf.usermodel HSSFChart getSheetCharts.

Prototype

public static HSSFChart[] getSheetCharts(HSSFSheet sheet) 

Source Link

Document

Returns all the charts for the given sheet.

Usage

From source file:com.haulmont.yarg.formatters.impl.XLSFormatter.java

License:Apache License

protected void copyCharts(HSSFSheet resultSheet) {
    HSSFChart[] sheetCharts = HSSFChart.getSheetCharts(resultSheet);
    if (sheetCharts == null || sheetCharts.length == 0) {//workaround for charts. If there is charts on sheet - we can not use getDrawPatriarch as it removes all charts (because does not support them)
        HSSFPatriarch drawingPatriarch = resultSheet.createDrawingPatriarch();
        if (drawingPatriarch == null) {
            drawingPatriarch = resultSheet.createDrawingPatriarch();
        }//  w w  w . j  a va  2 s .  c o m

        drawingPatriarchsMap.put(resultSheet, drawingPatriarch);
    }
}