@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
(图表部分的根元素)
|
static int |
DEFAULT_HEIGHT
default height of chart in emu
(emu中图表的默认高度)
|
static int |
DEFAULT_WIDTH
default width of chart in emu
(emu中图表的默认宽度)
|
static int |
DEFAULT_X
default x-coordinate of chart in emu
(emu 中图表的默认 x 坐标)
|
static int |
DEFAULT_Y
default y-coordinate value of chart in emu
(emu 中图表的默认 y 坐标值)
|
Modifier | Constructor and Description |
---|---|
protected |
XDDFChart()
Construct a chart.
(构建图表。)
|
protected |
XDDFChart(PackagePart part)
Construct a DrawingML chart from a package part.
(从包部件构造 DrawingML 图表。)
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all properties, as if a new instance had just been created.
(清除所有属性,就像刚刚创建了一个新实例一样。)
|
void |
clearChartSeries()
Clear all chart series, as if a new instance had just been created.
(清除所有图表系列,就像刚刚创建了一个新实例一样。)
|
protected void |
commit()
save chart xml
(保存图表 xml)
|
XDDFCategoryAxis |
createCategoryAxis(AxisPosition pos) |
XDDFChartData |
createData(ChartTypes type, XDDFChartAxis category, XDDFValueAxis values)
this method will return specified chart data with category and series 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
(与嵌入部分创建关系的方法,例如将 xlsx 文件流写入输出流)
|
XDDFSeriesAxis |
createSeriesAxis(AxisPosition pos)
this method will return series axis with specified position
(此方法将返回具有指定位置的系列轴)
|
XDDFValueAxis |
createValueAxis(AxisPosition pos) |
void |
deleteLegend() |
void |
deleteShapeProperties() |
void |
displayBlanksAs(DisplayBlanks as) |
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.Predicate<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties> isSet, java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,R> getter) |
<R> java.util.Optional<R> |
findDefinedRunProperty(java.util.function.Predicate<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties> 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
(返回图表空间内的底层 CTChart bean)
|
org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace |
getCTChartSpace()
Return the underlying CTChartSpace bean, the root element of the Chart part.
(返回底层 CTChartSpace bean,即 Chart 部件的根元素。)
|
protected org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea |
getCTPlotArea()
Return the underlying CTPlotArea bean, within the Chart
(返回图表中的底层 CTPlotArea bean)
|
XDDFTextBody |
getFormattedTitle()
Get the chart title body if there is one, i.e.
(如果有,则获取图表标题正文,即)
|
XDDFChartLegend |
getOrAddLegend() |
XDDFManualLayout |
getOrAddManualLayout() |
XDDFShapeProperties |
getOrAddShapeProperties() |
XDDFView3D |
getOrAddView3D()
Get or Add chart 3D view into chart
(获取或添加图表 3D 视图到图表中)
|
XDDFTitle |
getTitle() |
java.lang.Boolean |
getTitleOverlay() |
XSSFWorkbook |
getWorkbook() |
void |
importContent(XDDFChart other)
import content from other chart to created chart
(从其他图表导入内容到创建的图表)
|
protected long |
incrementSeriesCount() |
boolean |
isPlotOnlyVisibleCells() |
void |
plot(XDDFChartData data) |
void |
removeTitle()
Remove the chart title.
(删除图表标题。)
|
void |
saveWorkbook(XSSFWorkbook workbook)
this method write the XSSFWorkbook object data into embedded excel file
(此方法将 XSSFWorkbook 对象数据写入嵌入式 excel 文件)
|
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
(将嵌入的 excel 关系 id 的关系 id 设置为外部数据关系标签)
|
void |
setFloor(int thickness) |
void |
setPlotOnlyVisibleCells(boolean only) |
CellReference |
setSheetTitle(java.lang.String title, int column)
set sheet title in excel file
(在excel文件中设置工作表标题)
|
void |
setSideWall(int thickness) |
void |
setTitleOverlay(boolean overlay) |
void |
setTitleText(java.lang.String text)
Sets the title text as a static string.
(将标题文本设置为静态字符串。)
|
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
(从模板文件中读取图表时,我们需要解析嵌入的excel文件并将其存储在图表对象中,以显示我们可以根据用途修改值)
|
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final int DEFAULT_X
public static final int DEFAULT_Y
protected 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+xml
(part - 包含图表数据的包部分,内容类型必须是 application/vnd.openxmlformats-officedocument.drawingml.chart+xml)
java.io.IOException
(java.io.IOException)
org.apache.xmlbeans.XmlException
(org.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 void clear()
public boolean isPlotOnlyVisibleCells()
public void setPlotOnlyVisibleCells(boolean only)
only
- a flag specifying if only visible cells should be present on the chart
(only - 一个标志,指定图表上是否应仅存在可见单元格)
public void setFloor(int thickness)
public void setBackWall(int thickness)
public void setSideWall(int thickness)
public void setAutoTitleDeleted(boolean deleted)
public void displayBlanksAs(DisplayBlanks as)
public java.lang.Boolean getTitleOverlay()
public void setTitleOverlay(boolean overlay)
public void setTitleText(java.lang.String text)
text
- to use as new title
(text - 用作新标题)
public XDDFTitle getTitle()
public void removeTitle()
public XDDFView3D getOrAddView3D()
@Beta public XDDFTextBody getFormattedTitle()
public <R> java.util.Optional<R> findDefinedParagraphProperty(java.util.function.Predicate<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties> isSet, java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,R> getter)
findDefinedParagraphProperty
in interface
TextContainer
(在接口 TextContainer 中查找DefinedParagraphProperty)
public <R> java.util.Optional<R> findDefinedRunProperty(java.util.function.Predicate<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties> isSet, java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,R> getter)
findDefinedRunProperty
in interface
TextContainer
(接口 TextContainer 中的 findDefinedRunProperty)
public XDDFShapeProperties getOrAddShapeProperties()
public void deleteShapeProperties()
public XDDFChartLegend getOrAddLegend()
public void deleteLegend()
public XDDFManualLayout getOrAddManualLayout()
protected long incrementSeriesCount()
public void plot(XDDFChartData data)
public java.util.List<XDDFChartData> getChartSeries()
public void clearChartSeries()
public XDDFValueAxis createValueAxis(AxisPosition pos)
public XDDFSeriesAxis createSeriesAxis(AxisPosition pos)
pos
- axis position Left, Right, Top, Bottom
(pos - 轴位置左、右、上、下)
public XDDFCategoryAxis createCategoryAxis(AxisPosition pos)
public XDDFDateAxis createDateAxis(AxisPosition pos)
public XDDFChartData createData(ChartTypes type, XDDFChartAxis category, XDDFValueAxis values)
type
- chart type
(类型 - 图表类型)
category
- category values of chart
(category - 图表的类别值)
values
- series values of chart
(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 axis
(axisIndex - 0 - 主轴,1 - 次轴)
minimum
- minimum value; Double.NaN - automatic; null - no change
(最小值 - 最小值; Double.NaN - 自动; null - 没有变化)
maximum
- maximum value; Double.NaN - automatic; null - no change
(最大值 - 最大值; Double.NaN - 自动; null - 没有变化)
majorUnit
- major unit value; Double.NaN - automatic; null - no change
(majorUnit - 主要单位值; Double.NaN - 自动; null - 没有变化)
minorUnit
- minor unit value; Double.NaN - automatic; null - no change
(minorUnit - 次要单位值; Double.NaN - 自动; null - 没有变化)
public PackageRelationship createRelationshipInChart(POIXMLRelation chartRelation, POIXMLFactory chartFactory, int chartIndex)
chartRelation
- relationship object
(chartRelation - 关系对象)
chartFactory
- ChartFactory object
(chartFactory - ChartFactory 对象)
chartIndex
- index used to suffix on file
(chartIndex - 用于文件后缀的索引)
public void saveWorkbook(XSSFWorkbook workbook) throws java.io.IOException, InvalidFormatException
workbook
- XSSFworkbook object
(工作簿 - XSSFworkbook 对象)
java.io.IOException
(java.io.IOException)
InvalidFormatException
(无效格式异常)
protected abstract POIXMLRelation getChartRelation()
protected abstract POIXMLRelation getChartWorkbookRelation()
protected abstract POIXMLFactory getChartFactory()
protected void fillSheet(XSSFSheet sheet, XDDFDataSource<?> categoryData, XDDFNumericalDataSource<?> valuesData)
sheet
- sheet of embedded excel
(sheet - 嵌入的 excel 表)
categoryData
- category values
(categoryData - 类别值)
valuesData
- data values
(valuesData - 数据值)
public void importContent(XDDFChart other)
other
- chart object
(其他 - 图表对象)
protected void commit() throws java.io.IOException
commit
in class
POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committed
(java.io.IOException - 如果无法提交更改,子类可能会抛出 IOException)
public CellReference setSheetTitle(java.lang.String title, int column)
title
- title of sheet
(标题 - 工作表的标题)
column
- column index
(column - 列索引)
public java.lang.String formatRange(CellRangeAddress range)
range
-
(范围 -)
public XSSFWorkbook getWorkbook() throws java.io.IOException, InvalidFormatException
java.io.IOException
(java.io.IOException)
InvalidFormatException
(无效格式异常)
public void setWorkbook(XSSFWorkbook workbook)
workbook
- workbook object which we read from chart embedded part
(workbook - 我们从图表嵌入部分读取的工作簿对象)
public void setExternalId(java.lang.String id)
id
- relation id of embedded excel relation id into external data relation tag
(id - 嵌入到外部数据关系标签中的 excel 关系 id 的关系 id)
protected int getChartIndex()
public void setChartIndex(int chartIndex)
chartIndex
- chart index which can be use for relation part
(chartIndex - 可用于关系部分的图表索引)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.