Columns

You have the ability to control columns data. The columns section in the payload is defined as an Array.

Columns fields

Name

Type

Required

Description

text

String

true

The name for the column.

items

Array

true

An Array containing the sub columns.

Items array

Name

Type

Required

Description

text

String

true

The name of the sub-column.

base

Float

true

The base value for this column.

data

Array

true

The data values for each row. This should reflect the same order as the Array of rows defined in the chart settings.

Example in JSON

In this example we can see the correct data structure for 2 columns. In the second column we have two items while in the first column only one item.

{
  "columns": [{
    "text": "Total",
    "items": [{
      "text": "Total n=100",
      "base": 100,
      "data": [16, 5, 37, 42, 0]
    }]
  }, {
    "text": "Gender",
    "items": [{
      "text": "Male",
      "base": 100,
      "data": [16, 5, 37, 42, 0]
    }, {
      "text": "Female",
      "base": 100,
      "data": [20, 15, 47, 22, 10]
    }]
  }]
}

Last updated