org.apache.poi.xssf.usermodel

## Class XSSFChart

- java.lang.Object
- - org.apache.poi.ooxml.POIXMLDocumentPart
  - - org.apache.poi.xddf.usermodel.chart.XDDFChart
    - - org.apache.poi.xssf.usermodel.XSSFChart

- All Implemented Interfaces:
    Chart, ChartAxisFactory, ManuallyPositionable, TextContainer

      public final class XSSFChart
      extends XDDFChart
      implements Chart, ChartAxisFactory

  Represents a SpreadsheetML Chart

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart

      `POIXMLDocumentPart.RelationPart`

  - ### Field Summary

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

      `axes, chart, chartSpace, DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_X, DEFAULT_Y`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `XSSFChart()` Create a new SpreadsheetML chart
    `protected` | `XSSFChart(PackagePart part)` Construct a SpreadsheetML chart from a package part.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `commit()` save chart xml
    `XSSFCategoryAxis` | `createCategoryAxis(AxisPosition pos)` Deprecated.
    `XSSFDateAxis` | `createDateAxis(AxisPosition pos)` Deprecated.
    `XSSFValueAxis` | `createValueAxis(AxisPosition pos)` Deprecated.
    `java.util.List<? extends XSSFChartAxis>` | `getAxis()` Deprecated. use `XDDFChart.getAxes()` instead
    `XSSFChart` | `getChartAxisFactory()` Deprecated.
    `XSSFChartDataFactory` | `getChartDataFactory()` Deprecated.
    `protected POIXMLFactory` | `getChartFactory()`
    `protected POIXMLRelation` | `getChartRelation()`
    `protected POIXMLRelation` | `getChartWorkbookRelation()`
    `XSSFGraphicFrame` | `getGraphicFrame()` Returns the parent graphic frame.
    `XSSFManualLayout` | `getManualLayout()` Deprecated.
    `XSSFChartLegend` | `getOrCreateLegend()` Deprecated.
    `java.lang.String` | `getTitleFormula()` Get the chart title formula expression if there is one
    `XSSFRichTextString` | `getTitleText()` Returns the title static text, or null if none is set.
    `void` | `plot(ChartData data, ChartAxis... chartAxis)` Deprecated.
    `protected void` | `setGraphicFrame(XSSFGraphicFrame frame)` Sets the parent graphic frame.
    `void` | `setTitleFormula(java.lang.String formula)` Set the formula expression to use for the chart title

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

      `clear, clearChartSeries, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.poi.ss.usermodel.Chart

      `deleteLegend`

- - ### Constructor Detail

    - #### XSSFChart

          protected XSSFChart()

      Create a new SpreadsheetML chart

    - #### XSSFChart

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

      Construct a SpreadsheetML 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 3.14-Beta1

  - ### 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.

    - #### commit

          protected void commit()
                         throws java.io.IOException

      Description copied from class: `XDDFChart`
      save chart xml
      Overrides:
        `commit` in class `XDDFChart`
      Throws:
        `java.io.IOException` - a subclass may throw an IOException if the changes can't be committed

    - #### getGraphicFrame

          public XSSFGraphicFrame getGraphicFrame()

      Returns the parent graphic frame.
      Returns:
        the graphic frame this chart belongs to

    - #### setGraphicFrame

          protected void setGraphicFrame(XSSFGraphicFrame frame)

      Sets the parent graphic frame.

    - #### getChartDataFactory

          @Deprecated
           @Removal(version="4.2")
          public XSSFChartDataFactory getChartDataFactory()

      Deprecated.
      Specified by:
        `getChartDataFactory` in interface `Chart`
      Returns:
        an appropriate ChartDataFactory implementation

    - #### getChartAxisFactory

          @Deprecated
           @Removal(version="4.2")
          public XSSFChart getChartAxisFactory()

      Deprecated.
      Specified by:
        `getChartAxisFactory` in interface `Chart`
      Returns:
        an appropriate ChartAxisFactory implementation

    - #### plot

          @Deprecated
           @Removal(version="4.2")
          public void plot(ChartData data,
                                                                ChartAxis... chartAxis)

      Deprecated.
      Description copied from interface: `Chart`
      Plots specified data on the chart.
      Specified by:
        `plot` in interface `Chart`
      Parameters:
        `data` - a data to plot

    - #### createValueAxis

          @Deprecated
           @Removal(version="4.2")
          public XSSFValueAxis createValueAxis(AxisPosition pos)

      Deprecated.
      Specified by:
        `createValueAxis` in interface `ChartAxisFactory`
      Returns:
        new value axis at the end of the list at the specified chart position

    - #### createCategoryAxis

          @Deprecated
           @Removal(version="4.2")
          public XSSFCategoryAxis createCategoryAxis(AxisPosition pos)

      Deprecated.
      Specified by:
        `createCategoryAxis` in interface `ChartAxisFactory`
      Returns:
        new category axis at the end of the list at the specified chart position

    - #### createDateAxis

          @Deprecated
           @Removal(version="4.2")
          public XSSFDateAxis createDateAxis(AxisPosition pos)

      Deprecated.
      Specified by:
        `createDateAxis` in interface `ChartAxisFactory`
      Returns:
        new date category axis at the end of the list at the specified chart position

    - #### getAxis

          @Deprecated
           @Removal(version="4.2")
          public java.util.List<? extends XSSFChartAxis> getAxis()

      Deprecated. use `XDDFChart.getAxes()` instead
      Specified by:
        `getAxis` in interface `Chart`
      Returns:
        list of all chart axis

    - #### getManualLayout

          @Deprecated
           @Removal(version="4.2")
          public XSSFManualLayout getManualLayout()

      Deprecated.
      Description copied from interface: `ManuallyPositionable`
      Returns manual layout for the chart element.
      Specified by:
        `getManualLayout` in interface `ManuallyPositionable`
      Returns:
        manual layout for the chart element.

    - #### getTitleText

          public XSSFRichTextString getTitleText()

      Returns the title static text, or null if none is set. Note that a title formula may be set instead. Empty text result is for backward compatibility, and could mean the title text is empty or there is a formula instead. Check for a formula first, falling back on text for cleaner logic.
      Returns:
        static title text if set, null if there is no title, empty string if the title text is empty or the title uses a formula instead

    - #### getTitleFormula

          public java.lang.String getTitleFormula()

      Get the chart title formula expression if there is one
      Returns:
        formula expression or null

    - #### setTitleFormula

          public void setTitleFormula(java.lang.String formula)

      Set the formula expression to use for the chart title
      Parameters:
        `formula` -

    - #### getOrCreateLegend

          @Deprecated
           @Removal(version="4.2")
          public XSSFChartLegend getOrCreateLegend()

      Deprecated.
      Specified by:
        `getOrCreateLegend` in interface `Chart`
      Returns:
        chart legend instance

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