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 basechartSeries() - 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
enum ChartType
Types 8
enumChartType
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 namestring dimensionstring styleNamestring chartNamestring titlestring minimumstring maximumstring originstring logarithmicstring textRotationstring displayLabelstring visiblestring reverseDirectionXmlElement[] unknownChildrenMethods
structChartSeries
Describes a data series in a chart.
Fields
string styleNamestring valuesCellRangestring labelCellAddressstring attachedAxisstring[] categoriesXmlElement[] unknownChildrenMethods
structChartDataTable
Describes a chart data table (inline data source).
structChartLegend
Describes a chart legend.
Fields
string styleNamestring positionstring alignmentstring expansionstring displayXmlElement[] unknownChildrenMethods
structChartTitle
Describes a chart title or subtitle.
Methods
structChartPlotArea
Describes the plot area of a chart.
Contains axes, series, and the chart type sub-element.
Fields
ChartType chartTypestring styleNamestring dataSourceHasLabelsstring tableNumberChartAxis[] axesChartSeries[] seriesChartDataTable dataTableXmlElement[] unknownElementsMethods
structOdfChartBody
Top-level model for office:chart body content.
Fields
ChartTitle titleChartTitle subtitleChartLegend legendChartPlotArea plotAreaXmlElement[] unknownElementsMethods
bool isEmpty() const @safe pure nothrowReturns `true` when the chart body has no plot area configuration.Functions 21
fn
OdfChartBody parseChartBody(XmlElement chartElement)Parses an `office:chart` XML element into an `OdfChartBody`.fn
string serializeChartBody(const ref OdfChartBody body)Serialises an `OdfChartBody` to an XML fragment string.fn
OdfChartBody barChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a bar chart.fn
OdfChartBody lineChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a line chart.fn
OdfChartBody areaChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with an area chart.fn
OdfChartBody scatterChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a scatter chart.fn
OdfChartBody radarChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a radar chart.fn
OdfChartBody bubbleChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a bubble chart.fn
OdfChartBody stockChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a stock chart.fn
OdfChartBody surfaceChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a surface chart.fn
OdfChartBody ganttChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a gantt chart.fn
OdfChartBody filledRadarChart(ChartAxis[] axes, ChartSeries[] series)Constructs an `OdfChartBody` with a filled radar chart.fn
ChartAxis chartAxis(string dimension, string styleName = "",
string chartName = "")Constructs a `ChartAxis`.fn
ChartSeries chartSeries(string valuesCellRange, string labelCellAddress = "",
string attachedAxis = "")Constructs a `ChartSeries`.fn
ChartSeries dataSeries(string valuesCellRange, string labelCellAddress = "",
string attachedAxis = "", string styleName = "")Constructs a `ChartSeries` with the correct return type.