Class XSLFDiagram
- All Implemented Interfaces:
GraphicalFrame<XSLFShape,,XSLFTextParagraph> PlaceableShape<XSLFShape,,XSLFTextParagraph> Shape<XSLFShape,XSLFTextParagraph>
This class converts the diagram to an XSLFGroupShape accessible via getGroupShape(). The underlying
XSLFDiagramDrawing used to create the group shape is accessible via getDiagramDrawing().
In pptx files, these diagrams are generated by creating SmartArt. When a pptx has SmartArt, a directory with the following structure is created:
ppt/
diagrams/
data#.xml
drawing#.xml^
colors#.xml
quickStyle#.xml
layout#.xml
rels/
data#.xml.rels
drawing#.xml.rels
^The `drawing#.xml` file is not in the OpenXML spec. It was added as an extension by Microsoft, namespace: http://schemas.microsoft.com/office/drawing/2008/diagram
The drawing#.xml file contains the rendered output of the diagram. This class reads the underlying drawing#.xml and
converts it to a XSLFGroupShape.
The data, drawing, colors, and quickStyle files are in the OpenXML spec. These contain the instructions that define how to render the diagram. Rendering diagrams from these files is not trivial, they support for loops, if/elses, etc. Integrating such a change into POI would be quite sophisticated and challenging.
- Since:
- POI 5.2.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.xslf.usermodel.XSLFShape
XSLFShape.ReparseFactory<T extends XmlObject> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the underlyingXSLFDiagramDrawingused to create this diagram.org.apache.poi.xslf.usermodel.XSLFDiagram.XSLFDiagramGroupShapeReturns the diagram represented as a grouped shape.Methods inherited from class org.apache.poi.xslf.usermodel.XSLFGraphicFrame
getAnchor, getChart, getFallbackPicture, getFlipHorizontal, getFlipVertical, getRotation, getShapeType, hasChart, hasDiagram, setAnchor, setFlipHorizontal, setFlipVertical, setRotationMethods inherited from class org.apache.poi.xslf.usermodel.XSLFShape
draw, fetchShapeProperty, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getSheet, getXmlObject, isPlaceholder, setParent, setPlaceholderMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getParent, getSheetMethods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getParent, getShapeId, getShapeName, getSheet
-
Field Details
-
DRAWINGML_DIAGRAM_URI
- See Also:
-
-
Method Details
-
getDiagramDrawing
Returns the underlyingXSLFDiagramDrawingused to create this diagram.NOTE: Modifying this drawing will not update the groupShape returned from
getGroupShape(). -
getGroupShape
public org.apache.poi.xslf.usermodel.XSLFDiagram.XSLFDiagramGroupShape getGroupShape()Returns the diagram represented as a grouped shape.
-