OPF
SpecDefinition referenceView source

Data Column

A named data column with an optional number format. Anywhere a chart or dataset column is a string it may be a DataColumn; the string form is { "name": value } with no format. A table column header may also be a DataColumn.

Metadata

Definition
#/$defs/DataColumn
Form
object
Source
spec/schemas/opf.schema.json

Field index

FieldTypeReq.Description
namestringyesColumn label, used as the series name, the table header and the name 'fields' and 'chart.mapping' address.
formatref:NumberFormat—Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form.

name

typestringrequiredyesdefault—

Column label, used as the series name, the table header and the name 'fields' and 'chart.mapping' address.

Field fragment · name.json
{
  "name": "Revenue"
}

format

typeref:NumberFormatrequirednodefault—

Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form.

Complete definition constraints
Exact schema constraints
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "name"
  ],
  "description": "A named data column with an optional number format. Anywhere a chart or dataset column is a string it may be a DataColumn; the string form is { \"name\": value } with no format. A table column header may also be a DataColumn.",
  "properties": {
    "name": {
      "type": "string",
      "description": "Column label, used as the series name, the table header and the name 'fields' and 'chart.mapping' address.",
      "examples": [
        "Revenue",
        "Margin"
      ]
    },
    "format": {
      "$ref": "#/$defs/NumberFormat",
      "description": "Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form."
    }
  },
  "examples": [
    {
      "name": "Revenue",
      "format": "$#,##0.0"
    },
    {
      "name": "Margin",
      "format": "0%"
    }
  ]
}