Example usage for org.apache.poi.xssf.usermodel XSSFChart getParent

List of usage examples for org.apache.poi.xssf.usermodel XSSFChart getParent

Introduction

In this page you can find the example usage for org.apache.poi.xssf.usermodel XSSFChart getParent.

Prototype

public final POIXMLDocumentPart getParent() 

Source Link

Document

Returns the parent POIXMLDocumentPart.

Usage

From source file:org.tiefaces.components.websheet.chart.ChartHelper.java

License:MIT License

/**
 * Gets the chart id from parent./*from w  w w  . j  a v  a2s . c om*/
 *
 * @param chart
 *            the chart
 * @param sheetName
 *            the sheet name
 * @return the chart id from parent
 */
private String getChartIdFromParent(final XSSFChart chart, final String sheetName) {
    if (chart.getParent() != null) {
        for (RelationPart rp : chart.getParent().getRelationParts()) {
            if (rp.getDocumentPart() == chart) {
                return sheetName + "!" + rp.getRelationship().getId();
            }
        }
    }
    return null;
}