AG Studio: Build dashboards using native components in web apps. Join us for a webinar on 28th July at 2pm UTC+1 Register

JavaScript Embedded AnalyticsData Types

Studio supports a variety of data types. Instead of being defined directly on fields, data types are defined on Formats. A Format controls formatting along with other behaviour.

const fields = [
    {
        id: 'athlete',
        format: 'textFormat' // textFormat uses the `string` data type
    },
    // ... other fields
];

When using Sync Data and not providing fields, the format is inferred from the data.

Data Types Copy Link

Each of the data types are described in the table below. The input type is the JavaScript type that is supported in the source data. The default Format is the Format that will be used when inferring fields.

Data TypeInput TypeDefault Format
stringstringtextFormat
numbernumberintegerFormat / decimalFormat
booleanbooleanbooleanFormat
dateDate | string | numberdateFormat
datetimeDate | string | numberdateTimeFormat

For date and datetime, the string value is expected to be in ISO-8601 format, and the number value is Unix epoch.

See Formatting for how each data type is displayed and how to customise the display format.