Skip to content

Stacked area chart

Prints two or more non-negative numeric series stacked over a shared x-axis.

Series labels must be unique and every series must contain the same number of values. If yMax is provided, it must be at least as large as every stacked total.

Example

{
  "type": "stackedAreaChart",
  "series": [
    {
      "label": "Solar",
      "values": [
        5,
        8,
        7
      ]
    },
    {
      "label": "Grid",
      "values": [
        4,
        3,
        6
      ]
    }
  ],
  "xLabels": [
    "Mon",
    "Tue",
    "Wed"
  ]
}

Fields

FieldTypeDescription
typerequired"stackedAreaChart"

Discriminator for stacked-area-chart blocks.

seriesrequiredarray<object>

Two to four non-negative series stacked by x value.

  • Minimum items: 2
  • Maximum items: 4
Nested fields
FieldTypeDescription
labelrequiredstring

Short chart label.

  • Maximum length: 32
valuesrequiredarray<number>

Values in this series, ordered along the x-axis.

  • Minimum items: 2
  • Maximum items: 48
xLabelsoptionalarray<string>

Optional x-axis labels for each data point. Keep labels as short as possible.

  • Minimum items: 2
  • Maximum items: 48
yMaxoptionalnumber

Optional upper bound for stacked totals.

  • Minimum: 0