Sparkline

One series inline: 80×24, the last point as a dot.

View source
gpt-534
import { Sparkline } from "@logicplanes/kaeso-ui";

Props

  • aria-label
    string

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

  • color
    string = var(--k-viz-1)

    The line's color (var(--k-viz-1) by default). Pass seriesColor(id) to match the series elsewhere.

  • fluid
    boolean

    Fills the container's width at 32px high, without the last point's dot, as in a stat tile. Otherwise it is 80×24.

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

    Writes a value in the tooltip, such as "1,467" or "$2.06".

  • height
    number

    The height of a fluid sparkline in px; 32 by default.

  • labels
    string[]

    One name per value, such as each day; with them the sparkline can be inspected by pointer or arrow keys, with a crosshair and a tooltip.

  • seriesLabel
    string

    What the values are, named in the tooltip.

  • values
    number[]

    The values in order, oldest first. One value is a dot at the newest end; none is a quiet flat line.