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

      @Beta
      public class XWPFChart
      extends XDDFChart

  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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_HEIGHT` default height of chart in emu
    `static int` | `DEFAULT_WIDTH` default width of chart in emu

    - ### Fields inherited from class org.apache.poi.xddf.usermodel.chart.XDDFChart

      `axes, chart, chartSpace, DEFAULT_X, DEFAULT_Y`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `XWPFChart()` constructor to Create a new chart in document
    `protected` | `XWPFChart(PackagePart part)` Construct a chart from a package part.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `attach(java.lang.String chartRelId, XWPFRun run)` Attach this chart known by its relation id to the given text run.
    `boolean` | `equals(java.lang.Object obj)`
    `long` | `getChartBottomMargin(long margin)` get margin from Bottom
    `protected POIXMLFactory` | `getChartFactory()`
    `long` | `getChartHeight()` get chart height
    `long` | `getChartLeftMargin(long margin)` get margin from left
    `protected POIXMLRelation` | `getChartRelation()`
    `long` | `getChartRightMargin(long margin)` get margin from Right
    `long` | `getChartTopMargin(long margin)` get margin from Top
    `long` | `getChartWidth()` get chart width
    `protected POIXMLRelation` | `getChartWorkbookRelation()`
    `java.lang.Long` | `getChecksum()`
    `int` | `hashCode()`
    `void` | `setChartBottomMargin(long margin)` set margin from bottom
    `void` | `setChartBoundingBox(long width, long height)` set chart height and width
    `void` | `setChartHeight(long height)` set chart height
    `void` | `setChartLeftMargin(long margin)` set margin from left
    `void` | `setChartMargin(long top, long right, long bottom, long left)` set chart margin
    `void` | `setChartRightMargin(long margin)` set margin from Right
    `void` | `setChartTopMargin(long margin)` set margin from top
    `void` | `setChartWidth(long width)` set chart width

    - ### Methods inherited from class org.apache.poi.xddf.usermodel.chart.XDDFChart

      `clear, clearChartSeries, commit, createCategoryAxis, createData, createDateAxis, createRelationshipInChart, createSeriesAxis, createValueAxis, deleteLegend, deleteShapeProperties, displayBlanksAs, fillSheet, findDefinedParagraphProperty, findDefinedRunProperty, formatRange, getAxes, getChartIndex, getChartSeries, getCTChart, getCTChartSpace, getCTPlotArea, getFormattedTitle, getOrAddLegend, getOrAddManualLayout, getOrAddShapeProperties, getOrAddView3D, getTitle, getTitleOverlay, getWorkbook, importContent, incrementSeriesCount, 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, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommited, setCommitted, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_WIDTH

          public static final int DEFAULT_WIDTH

      default width of chart in emu
      See Also:
        Constant Field Values

    - #### DEFAULT_HEIGHT

          public static final int DEFAULT_HEIGHT

      default height of chart in emu
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### XWPFChart

          protected XWPFChart()

      constructor to Create a new chart in document
      Since:
        POI 4.0.0

    - #### XWPFChart

          protected XWPFChart(PackagePart part)
                       throws java.io.IOException,
                              org.apache.xmlbeans.XmlException

      Construct a chart from a package part.
      Parameters:
        `part` - the package part holding the chart data, the content type must be `application/vnd.openxmlformats-officedocument.drawingml.chart+xml`
      Throws:
        `java.io.IOException`
        `org.apache.xmlbeans.XmlException`
      Since:
        POI 4.0.0

  - ### Method Detail

    - #### getChartRelation

          protected POIXMLRelation getChartRelation()

      Specified by:
        `getChartRelation` in class `XDDFChart`
      Returns:
        the chart relation in the implementing subclass.

    - #### getChartWorkbookRelation

          protected POIXMLRelation getChartWorkbookRelation()

      Specified by:
        `getChartWorkbookRelation` in class `XDDFChart`
      Returns:
        the chart workbook relation in the implementing subclass.

    - #### getChartFactory

          protected POIXMLFactory getChartFactory()

      Specified by:
        `getChartFactory` in class `XDDFChart`
      Returns:
        the chart factory in the implementing subclass.

    - #### getChecksum

          public java.lang.Long getChecksum()

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### attach

          protected void attach(java.lang.String chartRelId,
                                XWPFRun run)
                         throws InvalidFormatException,
                                java.io.IOException

      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`
        `java.io.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 chart
        `height` - 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 top
        `right` - margin from right
        `bottom` - margin from bottom
        `left` - margin from left
      Since:
        POI 4.0.0

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.