ddn.odf.chart

ODF chart document body model.

Provides typed access to office:chart content for creating and reading OpenDocument Chart files (.odc).

Chart constructs

Fully typed:

  • Chart type, plot area, axes, legends, and titles
  • Data series with cell-range references and categories
  • 14 chart type builders: barChart(), lineChart(), pieChart(), areaChart(), scatterChart(), donutChart(), radarChart(), bubbleChart(), stockChart(), surfaceChart(), ganttChart(), ringChart(), filledRadarChart(), and the base chartSeries()
  • Axis builders: chartAxis() with title and label formatting
  • Legend and title builders: chartLegend(), chartTitle()

Preservation-first (raw XML retained):

  • Complex data-source references beyond simple cell ranges
  • Custom regression curves and error indicators
  • Extension chart types from third-party office suites

Types 8

Discriminant for chart types.

BAR
LINE
AREA
PIE
DONUT
RADAR
SCATTER
BUBBLE
STOCK
SURFACE
GANTT
RING
FILLED_RADAR
UNKNOWN
structChartAxis

Describes a chart axis.

Fields
string name
string dimension
string styleName
string chartName
string title
string minimum
string maximum
string origin
string logarithmic
string textRotation
string displayLabel
string visible
string reverseDirection
XmlElement[] unknownChildren
Methods
bool isEmpty() const @safe pure nothrowReturns `true` when this axis has minimal configuration.

Describes a data series in a chart.

Fields
string styleName
string valuesCellRange
string labelCellAddress
string attachedAxis
string[] categories
XmlElement[] unknownChildren
Methods
bool isEmpty() const @safe pure nothrowReturns `true` when this series has no data references.

Describes a chart data table (inline data source).

Fields
string[] categories
XmlElement[] unknownElements

Describes a chart legend.

Fields
string styleName
string position
string alignment
string expansion
string display
XmlElement[] unknownChildren
Methods
bool isEmpty() const @safe pure nothrowReturns `true` when the legend has no configuration.

Describes a chart title or subtitle.

Fields
string text
string styleName
string tableType
string cellRange
XmlElement[] unknownChildren
Methods
bool isEmpty() const @safe pure nothrowReturns `true` when the title has no content.

Describes the plot area of a chart.

Contains axes, series, and the chart type sub-element.

Fields
ChartType chartType
string styleName
string dataSourceHasLabels
string tableNumber
ChartAxis[] axes
ChartSeries[] series
ChartDataTable dataTable
XmlElement[] unknownElements
Methods
size_t seriesCount() const @safe pure nothrowReturns the number of data series.
size_t axisCount() const @safe pure nothrowReturns the number of axes.

Top-level model for office:chart body content.

Fields
ChartTitle subtitle
ChartPlotArea plotArea
XmlElement[] unknownElements
Methods
ChartType chartType() const @safe pure nothrowReturns the chart type from the plot area.
size_t seriesCount() const @safe pure nothrowReturns the number of data series.
bool isEmpty() const @safe pure nothrowReturns `true` when the chart body has no plot area configuration.

Functions 35

fnOdfChartBody parseChartBody(XmlElement chartElement)Parses an `office:chart` XML element into an `OdfChartBody`.
fnOdfChartBody emptyChartBody() @safe pure nothrowReturns an empty `OdfChartBody`.
fnstring serializeChartBody(const ref OdfChartBody body)Serialises an `OdfChartBody` to an XML fragment string.
fnOdfChartBody barChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a bar chart.
fnOdfChartBody lineChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a line chart.
fnOdfChartBody pieChart(ChartSeries[] series)Constructs an `OdfChartBody` with a pie chart.
fnOdfChartBody areaChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with an area chart.
fnOdfChartBody scatterChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a scatter chart.
fnOdfChartBody donutChart(ChartSeries[] series)Constructs an `OdfChartBody` with a donut chart.
fnOdfChartBody radarChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a radar chart.
fnOdfChartBody bubbleChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a bubble chart.
fnOdfChartBody stockChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a stock chart.
fnOdfChartBody surfaceChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a surface chart.
fnOdfChartBody ganttChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a gantt chart.
fnOdfChartBody ringChart(ChartSeries[] series)Constructs an `OdfChartBody` with a ring chart.
fnOdfChartBody filledRadarChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a filled radar chart.
fnChartLegend chartLegend(string position, string styleName = "")Constructs a `ChartLegend`.
fnChartTitle chartTitle(string text, string styleName = "")Constructs a `ChartTitle`.
fnChartAxis chartAxis(string dimension, string styleName = "", string chartName = "")Constructs a `ChartAxis`.
fnChartSeries chartSeries(string valuesCellRange, string labelCellAddress = "", string attachedAxis = "")Constructs a `ChartSeries`.
fnChartSeries dataSeries(string valuesCellRange, string labelCellAddress = "", string attachedAxis = "", string styleName = "")Constructs a `ChartSeries` with the correct return type.
fnstring getChartAttr(XmlElement el, string qName) @trusted nothrow
fnChartType chartTypeFromLocal(string local) @safe pure nothrow
fnstring chartTypeTag(ChartType t) @safe pure nothrow
fnstring extractText(XmlElement el)
fnvoid serializeAxisElement(XmlElement parent, ref const ChartAxis a)
fnvoid serializeSeriesElement(XmlElement parent, ref const ChartSeries s)
fnvoid serializeChartTitleElement(XmlElement parent, ref const ChartTitle t, string tag)
fnvoid serializeLegendElement(XmlElement parent, ref const ChartLegend l)