Time Series

The Time Series chart visualises numeric values that change over time. Each numeric series is plotted as a separate line against a shared time axis and is commonly used for prices, metrics, P&L, volumes, and sensor data.

The chart automatically detects time and numeric columns and supports both wide and long data formats. When safe and unambiguous, long-format data is automatically pivoted into aligned series.

Day Sines

A sine/cosine wave over a period of days.

A sine/cosine wave over a period of days. Underlying data table for the sine/cosine wave.
  • kdb+ q
  • DuckDB

Supported Data Formats

1. Wide Format (Already Pivoted)

Each row represents a single point in time and each numeric column represents a separate time series.

  1. The first date or time column found is used for the x-axis.
  2. Each numeric column becomes one line on the chart.
  3. No pivoting or reshaping is required.
dtseriesAseriesB
2023-01-0110.212.5
2023-01-0210.812.9

2. Long Format (Time, Series, Value)

Pivot time-series data long to wide.

Each row represents a single observation for one series at one point in time. This format is common in SQL queries and financial datasets.

dtsymvalue
2023-01-01A10.2
2023-01-01B12.5
2023-01-02A10.8
2023-01-02B12.9

When QStudio can unambiguously identify a series dimension, it automatically pivots the data so each series becomes its own line on the chart.

Automatic Time-Series Pivoting

Automatic pivoting reduces boilerplate SQL and allows common time-series queries to work without manual reshaping. It is intentionally conservative to avoid misleading charts.

Conditions Required for Auto-Pivot

All of the following must be true:

  1. Exactly one time column (date, timestamp, or time).
  2. Exactly one numeric value column.
  3. One non-numeric column that:
    • Low cardinality (e.g. symbol, metric)
    • More than one distinct value
    • No duplicate (time, series) combinations
  4. The time column is not already unique; if every row has a unique timestamp, no pivot is needed.

Why These Rules Exist

  • Ensure there is a single, clear series dimension.
  • Prevent accidental pivots when multiple categorical columns exist.
  • Avoid silent aggregation or data loss.
  • If the structure is ambiguous, the data is rendered exactly as returned.

If auto-pivoting fails for any reason, QStudio safely falls back to the original result set and renders it unchanged.