Chartpack structure and metadata

Write the file as a list, with a dash before each main item. Begin with one chartpack item giving the format, version and report title. Follow it with charts and optional section headings, in the order readers should see them.

Minimal chartpack

- chartpack:
    format: gcubed-chartpack
    version: 1
    title: Policy experiment
- chart:
    title: USA inflation
    series:
      - variable: INFL(USA)

format is exactly gcubed-chartpack, and title is non-blank.

Choose a format version

Numeric version: 1 means the original 1.0.0 format. Choose a quoted version string for later features:

Version First added
"1.1.0" Table of contents
"1.2.0" series-delta bars and per-series endpoint years
"1.3.0" Explicit Sector Selection dimensions
"1.4.0" More chart types, display controls and custom axis labels

Use the version required by the newest feature in your file. A 1.4.0 chartpack needs a reporting package and template that accept this version. See template compatibility for the latest builder support and the separately checked Python package.

Add at least one chart

The report needs a chart entry after the metadata. For example:

- chartpack:
    format: gcubed-chartpack
    version: 1
    title: Inflation report
- chart:
    series:
      - variable: INFL(USA)

A metadata-only file has nothing to draw and is rejected by the versioned template schema.

Optional report controls

When the pack contains charts, its metadata can also request a table of contents or control which dimensions populate the HTML Sector Selection panel:

- chartpack:
    format: gcubed-chartpack
    version: "1.3.0"
    title: Sector results
    table_of_contents: true
    sector_selection_dimensions: [sectors]
    sector_selection_include_default: false
- section:
    label: Sector outcomes
- chart:
    title: Sector output
    series:
      - variable: OUP(a01,USA)

See defaults, sections and inheritance and sector-selection controls for complete recipes.

Several charts in presentation order

- chartpack:
    format: gcubed-chartpack
    version: 1
    title: Main results
- chart:
    title: Inflation
    series:
      - variable: INFL(USA)
- chart:
    title: Real GDP
    series:
      - variable: GDPR(USA)

Moving a chart item changes report order. Mapping-key order has no effect.

Common error: a root mapping

chartpack:
  format: gcubed-chartpack
  version: 1
  title: Invalid root

This is invalid because the root lacks the sequence marker -.

Keep the YAML simple

Save one UTF-8 YAML document in a .yaml file (.yml is also accepted). Use spaces for indentation, retain the spelling and capitalisation of field names, and quote version strings and colours beginning with #. Comments beginning with # may explain a choice.

Unknown fields are rejected or reported as warnings, depending on where they occur. Do not use YAML anchors, aliases or custom tags to reuse blocks: these are not supported. Use chartpack defaults or sections instead. Optional fields should be omitted when unused; an empty style or axis object, or a null bound, is invalid. - chart: {} is useful only when its series are inherited.

Defaults, sections and inheritance