TimeseriesChart

Spend over time: y labels on the right, a dashed grid, smart time ticks, a crosshair and tooltip.

View source
Spend per model, last 30 days
TimeGPT-5GPT-5 miniClaude Sonnet 4.5Claude Haiku 4.5
Sun 13 Sep$4.72$8.22$11.71$13.34
Mon 14 Sep$7.39$7.76$12.36$13.16
Tue 15 Sep$7.07$8.23$10.78$15.20
Wed 16 Sep$8.46$10.01$12.02$13.03
Thu 17 Sep$6.09$10.51$12.44$14.08
Fri 18 Sep$8.56$8.27$12.49$13.61
Sat 19 Sep$6.90$9.46$10.43$12.20
Sun 20 Sep$5.61$9.89$9.90$11.02
Mon 21 Sep$5.12$7.28$9.93$11.17
Tue 22 Sep$7.23$7.59$9.88$10.10
Wed 23 Sep$6.54$6.26$8.40$9.04
Thu 24 Sep$4.59$5.62$7.99$9.76
Fri 25 Sep$3.84$5.88$8.76$10.08
Sat 26 Sep$3.79$6.34$9.35$11.23
Sun 27 Sep$3.82$5.21$7.75$12.03
Mon 28 Sep$4.41$5.05$9.90$12.36
Tue 29 Sep$4.71$7.67$8.46$11.40
Wed 30 Sep$4.10$7.52$9.33$13.41
Thu 1 Oct$4.86$7.44$12.00$13.67
Fri 2 Oct$6.66$9.94$11.86$12.56
Sat 3 Oct$5.84$8.97$10.76$14.79
Sun 4 Oct$6.76$8.47$10.52$15.05
Mon 5 Oct$6.01$8.93$11.26$14.06
Tue 6 Oct$8.21$10.94$12.65$14.53
Wed 7 Oct$8.48$9.74$12.06$11.59
Thu 8 Oct$6.85$9.05$9.86$13.02
Fri 9 Oct$5.91$7.55$10.11$11.43
Sat 10 Oct$7.77$7.68$10.19$12.50
Sun 11 Oct$4.55$6.26$8.56$11.76
Mon 12 Oct$4.89$5.12$7.81$9.30
import { TimeseriesChart } from "@logicplanes/kaeso-ui";

Props

  • aria-label
    string

    The chart's accessible name ("Requests by model").

  • empty
    boolean

    Shows the empty state (emptyText) in place of the data, over the baseline and the time axis. By default it shows when there are no points; zeros are data and draw a flat line on the baseline.

  • emptyText
    ReactNode

    What the empty state says. Defaults to "No data for this period" in the provider's language.

  • error
    ReactNode

    The data failed to load: the chart keeps its height, hides its legend and table toggle, and says so quietly, with Try again when there is onRetry and otherwise a hint to reload the page. Errors are toasts, so the value isn't shown; pass true and toast the message where the request fails.

  • formatTick
    ((t: Date) => string)

    Names the times under the axis ("3 Aug", "2026"). Defaults to calendar ticks in timeZone; pass it with tickAt="points" for buckets.

  • formatTime
    ((t: Date) => string)

    Names a point's time in the tooltip, the table and for screen readers, where a point stands for more than its instant: "Week of 3 Aug", "Aug 2026".

  • formatValue
    ((v: number) => string)

    Formats values in the tooltip, the table and on the axis. Without it, values are written in full and the axis in short form (1.2M), and the axis takes the room its widest label needs.

  • height
    number = 240

    The plot's height in px (240 by default).

  • hideLegend
    boolean

    Hide the legend (one series).

  • highlight
    number

    Highlight a point in time as the pointer does, with the crosshair and tooltip: a linked view, or the states pages.

  • kind
    "stacked" | "line" | "area" = line

    line draws lines (default), area adds a light fill under each line, and stacked stacks the areas.

  • loading
    boolean

    The data is loading: the chart keeps its height and is marked busy; data already on screen dims and breathes, and with none yet the plot is a skeleton.

  • onRetry
    (() => void)

    Called when Try again is pressed after error; without it, the button doesn't show.

  • partial
    { first?: boolean; last?: boolean; ongoing?: boolean; }

    Marks the first or last point as covering only part of its span: the line to it is dashed and its tooltip says "partial". ongoing marks the last one as still counting, such as today, and says "so far".

  • series
    TimeSeries[]

    The series, each with an id, a label, points of t (a time) and v, and an optional color.

  • shares
    boolean = true

    Shows each series' share of the point's total in the tooltip (on by default). Turn it off when one series is part of another, such as errors within requests.

  • threshold
    { value: number; label: string; }

    A threshold line (a budget) in danger, dashed.

  • tickAt
    "time" | "points" = time

    time labels round times, as many as fit (default). points sets each point in the middle of an equal step and labels every nth one, as a bar chart places and labels its categories, so a bar chart of the same days lines up with it.

  • timeZone
    string

    The zone the axis and the default labels read times in, such as "UTC" for days counted in UTC. Defaults to the zone set with setFormatTimeZone, else the viewer's.