Use cases

Time Series visualization

Visualize time series data in your apps.


In-app sparklines

Create inline visualizations in your apps.


Features

All the common API features, plus:

Example

Example 1: Simple time series query

Get the total taco sales for the last 3 days, filtered by the restaurant name.

Usage

Arguments

The fields for querying a Metric in time series format.

A Metric’s time series query returns the values over a given time range aggregated by a given time granularity; day, month, or year, for example.

metric
MetricInput

The Metric to Query. It can be a pre-created one or it can be inlined here.

timeRange
TimeRangeInput

The time range for calculating the time series.

timeZone
String

The time zone to use. Dates and times are always returned in UTC, but setting the time zone influences relative time ranges and granularities.

You can set this to “America/Los_Angeles”, “Europe/Berlin”, or any other value in the IANA time zone database. Defaults to “UTC”.

granularity
TimeSeriesGranularity
required

The time granularity (hour, day, month, etc.) to aggregate the Metric values by.

filterSql
String

The Query Filters to apply before retrieving the time series data, in the form of SQL. If no Query Filters are provided, all data is included.

groupBy
[String!]

Columns to group by.

Response

The time series response object. It contains an array of time series labels and an array of Metric values for the given time range and Query Filters.

labels
[String!]
required

The time series labels.

values
[String]
required

The time series values.

groups
[TimeSeriesResponseGroup!]

The time series values for each group in groupBy, if specified.

query
QueryInfo
required

The Query statistics and metadata.

Embeddable UI components