@Beta public abstract class XDDFChart extends POIXMLDocumentPart implements TextContainer
POIXMLDocumentPart.RelationPart| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<XDDFChartAxis> |
axes |
protected org.openxmlformats.schemas.drawingml.x2006.chart.CTChart |
chart
Chart element in the chart space
|
protected org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace |
chartSpace
Root element of the Chart part
|
| Modifier | Constructor and Description |
|---|---|
protected |
XDDFChart()
Construct a chart.
|
protected |
XDDFChart(PackagePart part)
Construct a DrawingML chart from a package part.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
commit()
save chart xml
|
XDDFCategoryAxis |
createCategoryAxis(AxisPosition pos) |
XDDFChartData |
createData(ChartTypes type,
XDDFChartAxis category,
XDDFValueAxis values) |
XDDFDateAxis |
createDateAxis(AxisPosition pos) |
PackageRelationship |
createRelationshipInChart(POIXMLRelation chartRelation,
POIXMLFactory chartFactory,
int chartIndex)
method to create relationship with embedded part for example writing xlsx
file stream into output stream
|
XDDFValueAxis |
createValueAxis(AxisPosition pos) |
void |
deleteLegend() |
void |
deleteShapeProperties() |
protected void |
fillSheet(XSSFSheet sheet,
XDDFDataSource<?> categoryData,
XDDFNumericalDataSource<?> valuesData)
this method writes the data into sheet
|
<R> java.util.Optional<R> |
findDefinedParagraphProperty(java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,java.lang.Boolean> isSet,
java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,R> getter) |
<R> java.util.Optional<R> |
findDefinedRunProperty(java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,java.lang.Boolean> isSet,
java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,R> getter) |
java.lang.String |
formatRange(CellRangeAddress range) |
java.util.List<? extends XDDFChartAxis> |
getAxes() |
protected abstract POIXMLFactory |
getChartFactory() |
protected int |
getChartIndex() |
protected abstract POIXMLRelation |
getChartRelation() |
java.util.List<XDDFChartData> |
getChartSeries() |
protected abstract POIXMLRelation |
getChartWorkbookRelation() |
org.openxmlformats.schemas.drawingml.x2006.chart.CTChart |
getCTChart()
Return the underlying CTChart bean, within the Chart Space
|
org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace |
getCTChartSpace()
Return the underlying CTChartSpace bean, the root element of the Chart
part.
|
protected org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea |
getCTPlotArea()
Return the underlying CTPlotArea bean, within the Chart
|
XDDFTextBody |
getFormattedTitle()
Get the chart title body if there is one, i.e.
|
XDDFChartLegend |
getOrAddLegend() |
XDDFManualLayout |
getOrAddManualLayout() |
XDDFShapeProperties |
getOrAddShapeProperties() |
XSSFWorkbook |
getWorkbook() |
void |
importContent(XDDFChart other)
import content from other chart to created chart
|
boolean |
isPlotOnlyVisibleCells() |
void |
plot(XDDFChartData data) |
void |
saveWorkbook(XSSFWorkbook workbook)
this method write the XSSFWorkbook object data into embedded excel file
|
void |
setAutoTitleDeleted(boolean deleted) |
void |
setBackWall(int thickness) |
void |
setChartIndex(int chartIndex)
set chart index which can be use for relation part
|
void |
setExternalId(java.lang.String id)
set the relation id of embedded excel relation id into external data
relation tag
|
void |
setFloor(int thickness) |
void |
setPlotOnlyVisibleCells(boolean only) |
CellReference |
setSheetTitle(java.lang.String title)
set sheet time in excel file
|
void |
setSideWall(int thickness) |
void |
setValueRange(int axisIndex,
java.lang.Double minimum,
java.lang.Double maximum,
java.lang.Double majorUnit,
java.lang.Double minorUnit)
Set value range (basic Axis Options)
|
void |
setWorkbook(XSSFWorkbook workbook)
while reading chart from template file then we need to parse and store
embedded excel file in chart object show that we can modify value
according to use
|
_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, toStringprotected java.util.List<XDDFChartAxis> axes
protected final org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace chartSpace
protected final org.openxmlformats.schemas.drawingml.x2006.chart.CTChart chart
protected XDDFChart()
protected XDDFChart(PackagePart part) throws java.io.IOException, org.apache.xmlbeans.XmlException
part - the package part holding the chart data, the content type must
be
application/vnd.openxmlformats-officedocument.drawingml.chart+xmljava.io.IOExceptionorg.apache.xmlbeans.XmlException@Internal public org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace getCTChartSpace()
@Internal public org.openxmlformats.schemas.drawingml.x2006.chart.CTChart getCTChart()
@Internal protected org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea getCTPlotArea()
public boolean isPlotOnlyVisibleCells()
public void setPlotOnlyVisibleCells(boolean only)
only - a flag specifying if only visible cells should be present on
the chartpublic void setFloor(int thickness)
public void setBackWall(int thickness)
public void setSideWall(int thickness)
public void setAutoTitleDeleted(boolean deleted)
@Beta public XDDFTextBody getFormattedTitle()
public <R> java.util.Optional<R> findDefinedParagraphProperty(java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,java.lang.Boolean> isSet,
java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,R> getter)
findDefinedParagraphProperty in interface TextContainerpublic <R> java.util.Optional<R> findDefinedRunProperty(java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,java.lang.Boolean> isSet,
java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,R> getter)
findDefinedRunProperty in interface TextContainerpublic XDDFShapeProperties getOrAddShapeProperties()
public void deleteShapeProperties()
public XDDFChartLegend getOrAddLegend()
public void deleteLegend()
public XDDFManualLayout getOrAddManualLayout()
public void plot(XDDFChartData data)
public java.util.List<XDDFChartData> getChartSeries()
public XDDFValueAxis createValueAxis(AxisPosition pos)
public XDDFCategoryAxis createCategoryAxis(AxisPosition pos)
public XDDFDateAxis createDateAxis(AxisPosition pos)
public XDDFChartData createData(ChartTypes type, XDDFChartAxis category, XDDFValueAxis values)
public java.util.List<? extends XDDFChartAxis> getAxes()
public void setValueRange(int axisIndex,
java.lang.Double minimum,
java.lang.Double maximum,
java.lang.Double majorUnit,
java.lang.Double minorUnit)
axisIndex - 0 - primary axis, 1 - secondary axisminimum - minimum value; Double.NaN - automatic; null - no changemaximum - maximum value; Double.NaN - automatic; null - no changemajorUnit - major unit value; Double.NaN - automatic; null - no changeminorUnit - minor unit value; Double.NaN - automatic; null - no changepublic PackageRelationship createRelationshipInChart(POIXMLRelation chartRelation, POIXMLFactory chartFactory, int chartIndex)
chartRelation - relationship objectchartFactory - ChartFactory objectchartIndex - index used to suffix on filepublic void saveWorkbook(XSSFWorkbook workbook) throws java.io.IOException, InvalidFormatException
workbook - XSSFworkbook objectjava.io.IOExceptionInvalidFormatExceptionprotected abstract POIXMLRelation getChartRelation()
protected abstract POIXMLRelation getChartWorkbookRelation()
protected abstract POIXMLFactory getChartFactory()
protected void fillSheet(XSSFSheet sheet, XDDFDataSource<?> categoryData, XDDFNumericalDataSource<?> valuesData)
sheet - sheet of embedded excelcategoryData - category valuesvaluesData - data valuespublic void importContent(XDDFChart other)
other - chart objectprotected void commit()
throws java.io.IOException
commit in class POIXMLDocumentPartjava.io.IOException - a subclass may throw an IOException if the changes can't be committedpublic CellReference setSheetTitle(java.lang.String title)
title - title of sheetpublic java.lang.String formatRange(CellRangeAddress range)
range - public XSSFWorkbook getWorkbook() throws java.io.IOException, InvalidFormatException
java.io.IOExceptionInvalidFormatExceptionpublic void setWorkbook(XSSFWorkbook workbook)
workbook - workbook object which we read from chart embedded partpublic void setExternalId(java.lang.String id)
id - relation id of embedded excel relation id into external data
relation tagprotected int getChartIndex()
public void setChartIndex(int chartIndex)
chartIndex - chart index which can be use for relation part