OPF
SpecDefinition referenceView source

Chart Mapping

Series mapping by column name (after any 'fields' selection). Mapping only selects and orders columns; pie, doughnut and other single-series constructs still plot one series. An unknown name is a 'chart-mapping-unknown-column' error; a series that repeats the category or X column, and an X column on a chart type without an X axis, are dropped with a 'chart-mapping-adapted' warning.

Metadata

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

Field index

FieldTypeReq.Description
categorystring—The label (category) column. Default: the first column.
xstring—The X column of an XY (scatter) chart. Default: the second column (the first, when the category is the second column), and only when there are three or more columns: with two, the second column is the one series, plotted against row numbers. An X that leaves no series is plotted as the series with a 'chart-mapping-adapted' warning.
seriesarray<string>—The plotted columns, in order. Default: every column that is not the category or the X column.

category

typestringrequirednodefault—

The label (category) column. Default: the first column.

Field fragment · category.json
{
  "category": "Quarter"
}

x

typestringrequirednodefault—

The X column of an XY (scatter) chart. Default: the second column (the first, when the category is the second column), and only when there are three or more columns: with two, the second column is the one series, plotted against row numbers. An X that leaves no series is plotted as the series with a 'chart-mapping-adapted' warning.

Field fragment · x.json
{
  "x": "Spend"
}

series

typearray<string>requirednodefault—

The plotted columns, in order. Default: every column that is not the category or the X column.

Field fragment · series.json
{
  "series": [
    "Revenue",
    "Costs"
  ]
}
Complete definition constraints
Exact schema constraints
{
  "type": "object",
  "additionalProperties": false,
  "description": "Series mapping by column name (after any 'fields' selection). Mapping only selects and orders columns; pie, doughnut and other single-series constructs still plot one series. An unknown name is a 'chart-mapping-unknown-column' error; a series that repeats the category or X column, and an X column on a chart type without an X axis, are dropped with a 'chart-mapping-adapted' warning.",
  "properties": {
    "category": {
      "type": "string",
      "description": "The label (category) column. Default: the first column.",
      "examples": [
        "Quarter"
      ]
    },
    "x": {
      "type": "string",
      "description": "The X column of an XY (scatter) chart. Default: the second column (the first, when the category is the second column), and only when there are three or more columns: with two, the second column is the one series, plotted against row numbers. An X that leaves no series is plotted as the series with a 'chart-mapping-adapted' warning.",
      "examples": [
        "Spend"
      ]
    },
    "series": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "description": "The plotted columns, in order. Default: every column that is not the category or the X column.",
      "examples": [
        [
          "Revenue",
          "Costs"
        ]
      ]
    }
  },
  "examples": [
    {
      "category": "Quarter",
      "series": [
        "Costs",
        "Revenue"
      ]
    },
    {
      "category": "Region",
      "x": "Spend",
      "series": [
        "Revenue"
      ]
    }
  ]
}