java.lang.Object
com.independentsoft.office.odf.Document
com.independentsoft.office.odf.charts.Chart

public class Chart extends Document
The Class Chart.
  • Constructor Details

  • Method Details

    • open

      public void open(String filePath) throws IOException, XMLStreamException
      Description copied from class: Document
      Open.
      Specified by:
      open in class Document
      Parameters:
      filePath - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
      XMLStreamException - the xML stream exception
    • open

      public void open(InputStream inputStream) throws IOException, XMLStreamException
      Description copied from class: Document
      Open.
      Specified by:
      open in class Document
      Parameters:
      inputStream - the stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
      XMLStreamException - the xML stream exception
    • openImplementation

      protected void openImplementation(InputStream inputStream) throws IOException, XMLStreamException
      Overrides:
      openImplementation in class Document
      Throws:
      IOException
      XMLStreamException
    • renameStyle

      public void renameStyle(Style style, String newName)
      Rename style.
      Parameters:
      style - the style
      newName - the new name
    • getContentElements

      public List<IContentElement> getContentElements()
      Returns all content elements.
      Specified by:
      getContentElements in class Document
      Returns:
      A collection of content elements.
    • clone

      public Chart clone()
      Creates a new object that is a deep copy of the current instance.
      Overrides:
      clone in class Object
      Returns:
      A new object that is a copy of this instance.
    • save

      public void save(String filePath) throws IOException
      Description copied from class: Document
      Save.
      Specified by:
      save in class Document
      Parameters:
      filePath - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • save

      public void save(String filePath, boolean overwrite) throws IOException
      Description copied from class: Document
      Save.
      Specified by:
      save in class Document
      Parameters:
      filePath - the file
      overwrite - the overwrite
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • save

      public void save(OutputStream outputStream) throws IOException
      Description copied from class: Document
      Save.
      Specified by:
      save in class Document
      Parameters:
      outputStream - the stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getInputStream

      public InputStream getInputStream() throws IOException
      Description copied from class: Document
      Gets the input stream.
      Specified by:
      getInputStream in class Document
      Returns:
      the input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getBytes

      public byte[] getBytes() throws IOException
      Description copied from class: Document
      Gets the bytes.
      Specified by:
      getBytes in class Document
      Returns:
      the bytes
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • toSvg

      public String toSvg(double width, double height)
      Renders the chart as an SVG fragment.
      Parameters:
      width - The target width in pixels.
      height - The target height in pixels.
      Returns:
      The SVG markup, or null when the chart type is not supported.
    • saveAsHtml

      public void saveAsHtml(String file) throws IOException
      Saves the chart in HTML format.
      Specified by:
      saveAsHtml in class Document
      Parameters:
      file - The path of the file to save.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveAsHtml

      public void saveAsHtml(String file, boolean overwrite) throws IOException
      Saves the chart in HTML format.
      Specified by:
      saveAsHtml in class Document
      Parameters:
      file - The path of the file to save.
      overwrite - If true, overwrites an existing file.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveAsHtml

      public void saveAsHtml(OutputStream stream) throws IOException
      Saves the chart in HTML format.
      Specified by:
      saveAsHtml in class Document
      Parameters:
      stream - The stream to save to.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getHtml

      public String getHtml() throws IOException
      Converts the chart to HTML format. The chart is rendered as an inline SVG image.
      Specified by:
      getHtml in class Document
      Returns:
      The HTML representation of the chart.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getContent

      public ChartContent getContent()
      Gets the content.
      Returns:
      the content
    • getFonts

      public List<Font> getFonts()
      Gets the fonts.
      Returns:
      the fonts
    • getOfficeScripts

      public OfficeScripts getOfficeScripts()
      Gets the office scripts.
      Returns:
      the office scripts
    • getAutomaticStyles

      public AutomaticStyles getAutomaticStyles()
      Gets the automatic styles.
      Returns:
      the automatic styles