OPF
SpecDefinition referenceView source

Chart Data

Inline tabular data driving a chart, written as { "columns": ["Quarter", "Decks"], "rows": [["Q1", 3], ["Q2", 8]] }: one column of labels plus one column per series, not separate categories and series lists. The first column usually supplies category/x-axis labels; subsequent columns are plotted measures unless 'chart.mapping' or a chart type maps them differently. Value cells are numbers; a string is read only in strict decimal syntax ('12', '-3.5', '1e6'), and anything else ('12%', '$5', '(5)', '1,234') is a gap and a 'chart-value-not-numeric' warning.

Metadata

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

Field index

FieldTypeReq.Description
columnsarray<string | ref:DataColumn>yesOrdered column labels for the chart data table. A label is a string or a DataColumn ({ "name", "format" }) whose number format the data labels, value axis and exported workbook use.
rowsarray<array<ref:ChartDataCell>>yesTabular chart rows. Each row aligns by index with columns.
sourceref:DataSourceRef—Optional provenance: where this inline data came from. Engines never read, fetch or refresh it; they keep it through editing, export and re-import.

columns

typearray<string | ref:DataColumn>requiredyesdefault—

Ordered column labels for the chart data table. A label is a string or a DataColumn ({ "name", "format" }) whose number format the data labels, value axis and exported workbook use.

columns.json
{
  "columns": [
    "Quarter",
    "Revenue"
  ]
}

rows

typearray<array<ref:ChartDataCell>>requiredyesdefault—

Tabular chart rows. Each row aligns by index with columns.

rows.json
{
  "rows": [
    [
      "Q1",
      12
    ],
    [
      "Q2",
      18
    ],
    [
      "Q3",
      24
    ],
    [
      "Q4",
      31
    ]
  ]
}

source

typeref:DataSourceRefrequirednodefault—

Optional provenance: where this inline data came from. Engines never read, fetch or refresh it; they keep it through editing, export and re-import.

Complete definition constraints
Schema constraints
{
  "type": "object",
  "description": "Inline tabular data driving a chart, written as `{ \"columns\": [\"Quarter\", \"Decks\"], \"rows\": [[\"Q1\", 3], [\"Q2\", 8]] }`: one column of labels plus one column per series, not separate `categories` and `series` lists. The first column usually supplies category/x-axis labels; subsequent columns are plotted measures unless 'chart.mapping' or a chart type maps them differently. Value cells are numbers; a string is read only in strict decimal syntax ('12', '-3.5', '1e6'), and anything else ('12%', '$5', '(5)', '1,234') is a gap and a 'chart-value-not-numeric' warning.",
  "additionalProperties": false,
  "required": [
    "columns",
    "rows"
  ],
  "properties": {
    "columns": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "$ref": "#/$defs/DataColumn"
          }
        ]
      },
      "minItems": 1,
      "description": "Ordered column labels for the chart data table. A label is a string or a DataColumn ({ \"name\", \"format\" }) whose number format the data labels, value axis and exported workbook use.",
      "examples": [
        [
          "Quarter",
          "Revenue"
        ],
        [
          "Quarter",
          "Revenue",
          "Costs"
        ],
        [
          "Quarter",
          {
            "name": "Revenue",
            "format": "$#,##0.0"
          },
          {
            "name": "Margin",
            "format": "0%"
          }
        ]
      ]
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/ChartDataCell"
        }
      },
      "minItems": 1,
      "description": "Tabular chart rows. Each row aligns by index with columns.",
      "examples": [
        [
          [
            "Q1",
            12
          ],
          [
            "Q2",
            18
          ],
          [
            "Q3",
            24
          ],
          [
            "Q4",
            31
          ]
        ]
      ]
    },
    "source": {
      "$ref": "#/$defs/DataSourceRef",
      "description": "Optional provenance: where this inline data came from. Engines never read, fetch or refresh it; they keep it through editing, export and re-import."
    }
  }
}