Since 0.6, Simple ODF provides methods to manipulate charts in text document, spreadsheet document and presentation document. You can create, update and delete charts with these methods.
We all know, a chart is associated with a table. In order to create a chart, you must determine the data set of this chart. The data set can be a cell range of a table, for example:
If you want to create a chart in a presentation document, you can use the existing layout of a slide, which means, you don't need to specify a rectangle. The layouts that could contain a chart include: TITLE_PLUS_CHART, TITLE_PLUS_2_CHART, TITLE_LEFT_CHART_RIGHT_OUTLINE, TITLE_PLUS_3_OBJECT, and TITLE_PLUS_4_OBJECT. For example:
You can update charts properties, for example, the title, axis title, chart type, whether to apply 3D effect, whether to use legend with API. For example:
You can also get a chart by its unique ID. The unique ID of a chart in Simple ODF API is the path of the chart document (relative to the ODF document package). The unique ID can be gotten with method: