Package org.apache.poi.xwpf.usermodel
Class XWPFChart
java.lang.Object
org.apache.poi.ooxml.POIXMLDocumentPart
org.apache.poi.xddf.usermodel.chart.XDDFChart
org.apache.poi.xwpf.usermodel.XWPFChart
- All Implemented Interfaces:
TextContainer
Represents a Chart in a .docx file
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
default height of chart in emustatic final int
default width of chart in emuFields inherited from class org.apache.poi.xddf.usermodel.chart.XDDFChart
axes, chart, chartSpace
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
constructor to Create a new chart in documentprotected
XWPFChart
(PackagePart part) Construct a chart from a package part. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Attach this chart known by its relation id to the given text run.boolean
long
getChartBottomMargin
(long margin) get margin from Bottomprotected POIXMLFactory
long
get chart heightlong
getChartLeftMargin
(long margin) get margin from leftprotected POIXMLRelation
long
getChartRightMargin
(long margin) get margin from Rightlong
getChartTopMargin
(long margin) get margin from Toplong
get chart widthprotected POIXMLRelation
int
hashCode()
void
setChartBottomMargin
(long margin) set margin from bottomvoid
setChartBoundingBox
(long width, long height) set chart height and widthvoid
setChartHeight
(long height) set chart heightvoid
setChartLeftMargin
(long margin) set margin from leftvoid
setChartMargin
(long top, long right, long bottom, long left) set chart marginvoid
setChartRightMargin
(long margin) set margin from Rightvoid
setChartTopMargin
(long margin) set margin from topvoid
setChartWidth
(long width) set chart widthMethods inherited from class org.apache.poi.xddf.usermodel.chart.XDDFChart
commit, createCategoryAxis, createData, createDateAxis, createRelationshipInChart, createValueAxis, deleteLegend, deleteShapeProperties, displayBlanksAs, fillSheet, findDefinedParagraphProperty, findDefinedRunProperty, formatRange, getAxes, getChartIndex, getChartSeries, getCTChart, getCTChartSpace, getCTPlotArea, getFormattedTitle, getOrAddLegend, getOrAddManualLayout, getOrAddShapeProperties, getTitle, getTitleOverlay, getWorkbook, importContent, isPlotOnlyVisibleCells, plot, saveWorkbook, setAutoTitleDeleted, setBackWall, setChartIndex, setExternalId, setFloor, setPlotOnlyVisibleCells, setSheetTitle, setSideWall, setTitleOverlay, setTitleText, setValueRange, setWorkbook
Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommited, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommited, toString
-
Field Details
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTHdefault width of chart in emu- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHTdefault height of chart in emu- See Also:
-
-
Constructor Details
-
XWPFChart
protected XWPFChart()constructor to Create a new chart in document- Since:
- POI 4.0.0
-
XWPFChart
Construct a chart from a package part.- Parameters:
part
- the package part holding the chart data, the content type must beapplication/vnd.openxmlformats-officedocument.drawingml.chart+xml
- Throws:
IOException
org.apache.xmlbeans.XmlException
- Since:
- POI 4.0.0
-
-
Method Details
-
getChartRelation
- Specified by:
getChartRelation
in classXDDFChart
- Returns:
- the chart relation in the implementing subclass.
-
getChartWorkbookRelation
- Specified by:
getChartWorkbookRelation
in classXDDFChart
- Returns:
- the chart workbook relation in the implementing subclass.
-
getChartFactory
- Specified by:
getChartFactory
in classXDDFChart
- Returns:
- the chart factory in the implementing subclass.
-
getChecksum
-
equals
-
hashCode
public int hashCode() -
attach
Attach this chart known by its relation id to the given text run.- Parameters:
chartRelId
- the relation id of this chart in its parent document.run
- the text run to which this chart will be inlined.- Throws:
InvalidFormatException
IOException
- Since:
- POI 4.0.0
-
setChartHeight
public void setChartHeight(long height) set chart height- Parameters:
height
- height of chart- Since:
- POI 4.0.0
-
setChartWidth
public void setChartWidth(long width) set chart width- Parameters:
width
- width of chart- Since:
- POI 4.0.0
-
getChartHeight
public long getChartHeight()get chart height- Since:
- POI 4.0.0
-
getChartWidth
public long getChartWidth()get chart width- Since:
- POI 4.0.0
-
setChartBoundingBox
public void setChartBoundingBox(long width, long height) set chart height and width- Parameters:
width
- width of chartheight
- height of chart- Since:
- POI 4.0.0
-
setChartTopMargin
public void setChartTopMargin(long margin) set margin from top- Parameters:
margin
- margin from top- Since:
- POI 4.0.0
-
getChartTopMargin
public long getChartTopMargin(long margin) get margin from Top- Parameters:
margin
-- Since:
- POI 4.0.0
-
setChartBottomMargin
public void setChartBottomMargin(long margin) set margin from bottom- Parameters:
margin
- margin from Bottom- Since:
- POI 4.0.0
-
getChartBottomMargin
public long getChartBottomMargin(long margin) get margin from Bottom- Parameters:
margin
-- Since:
- POI 4.0.0
-
setChartLeftMargin
public void setChartLeftMargin(long margin) set margin from left- Parameters:
margin
- margin from left- Since:
- POI 4.0.0
-
getChartLeftMargin
public long getChartLeftMargin(long margin) get margin from left- Parameters:
margin
-- Since:
- POI 4.0.0
-
setChartRightMargin
public void setChartRightMargin(long margin) set margin from Right- Parameters:
margin
- from right- Since:
- POI 4.0.0
-
getChartRightMargin
public long getChartRightMargin(long margin) get margin from Right- Parameters:
margin
-- Since:
- POI 4.0.0
-
setChartMargin
public void setChartMargin(long top, long right, long bottom, long left) set chart margin- Parameters:
top
- margin from topright
- margin from rightbottom
- margin from bottomleft
- margin from left- Since:
- POI 4.0.0
-