Skip to main content

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:
Aggregate data by various time granularities.Available granularities:
  • MINUTE: Aggregates values by minute intervals
  • FIVE_MINUTES: Aggregates values by 5-minute intervals
  • TEN_MINUTES: Aggregates values by 10-minute intervals
  • FIFTEEN_MINUTES: Aggregates values by 15-minute intervals
  • HOUR: Aggregates values by hourly intervals
  • DAY: Aggregates values by daily intervals
  • WEEK: Aggregates values by weekly intervals
  • MONTH: Aggregates values by monthly intervals
  • YEAR: Aggregates values by yearly intervals
Group results by specific columns.
Query
Automatically zero-fills missing data points to ensure consistent time series.
Calculates time series granules for the given time zone, allowing for accurate representation of data across different geographical locations.
Query

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.
MetricInput
The Metric to Query. It can be a pre-created one or it can be inlined here.
TimeRangeInput
The time range for calculating the time series.
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”.
TimeSeriesGranularity
required
The time granularity (hour, day, month, etc.) to aggregate the Metric values by.
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.
[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.
[String!]
required
The time series labels.
[String]
required
The time series values.
[TimeSeriesResponseGroup!]
The time series values for each group in groupBy, if specified.
QueryInfo
required
The Query statistics and metadata.

Embeddable UI components

Time series component

A React component for rendering ready-to-chart time series data.

useTimeSeries

A React Hook for ready-to-chart time series data from the Time Series API.