@pond-ts/charts API Reference
    Preparing search index...

    Interface BarChartProps<S, VS>

    interface BarChartProps<
        S extends SeriesSchema = SeriesSchema,
        VS extends ValueSeriesSchema = ValueSeriesSchema,
    > {
        as?: string;
        axis?: string;
        binColors?: readonly (string | undefined)[];
        bins?: readonly BinRecord[];
        categories?: readonly CategoryDatum[];
        colors?: Readonly<Record<string, string>>;
        column?: string;
        columns?: readonly string[];
        gap?: number;
        id?: string;
        index?: number;
        ordinal?: boolean;
        orientation?: Orientation;
        series?:
            | TimeSeries<S>
            | ValueSeries<VS>
            | ReadonlyMap<string, TimeSeries<S>>;
    }

    Type Parameters

    • S extends SeriesSchema = SeriesSchema
    • VS extends ValueSeriesSchema = ValueSeriesSchema
    Index

    Properties

    as?: string

    The single series' semantic identifier — what the data is. The theme maps it to a BarStyle (theme.bar[as] ?? theme.bar.default). Single series onlyignored (not an error) on a stacked chart, which colours its segments per group instead (see colors).

    axis?: string

    Which <YAxis> (by its id) this layer scales against — the scale (as picks the style). Omitted ⇒ the row's default axis. For a horizontal histogram this is the bin (band) axis; for a vertical one the value axis.

    binColors?: readonly (string | undefined)[]

    Per-bin colours for a single-series band chart — binColors[i] fills bar i (aligned to the bins / bands in order), overriding the as/theme fill. This is the way to colour heart-rate / power zones or value bands each their own colour (the colors map above is per-group, for stacks). An undefined/short entry falls back to the theme fill. Meant for a single-series chart (column + bins, or a horizontal single series); on a multi-group stack it would tint every segment of a bin alike, so it's not the tool there.

    bins?: readonly BinRecord[]

    byColumn bin recordsArray<{ start, end, …aggregates }> from a value-band aggregation (series.byColumn('power', { width: 20 }, { seconds: … })). The value-axis alternative to series: column / columns name the aggregate field(s) to draw. Pair with ordinal for a category (band) axis.

    categories?: readonly CategoryDatum[]

    Categorical data — an ordered { label, value }[], one bar per category on a first-class ordinal category x-axis (the container infers xKind:'category' and builds a band scale over the labels). The transpose view's "columns on x": each label is a category (ticker / account / zone), value its bar height. Provide exactly one of series / bins / categories; categories takes no column/columns and is vertical only (categories on x). Colour per category via binColors. (Categorical-axis RFC, Phase 1.)

    colors?: Readonly<Record<string, string>>

    Per-group colour override for a stacked chart — { group: cssColor }. A segment resolves colors[group] ?? theme.bar[group]?.fill ?? theme.bar.default.fill, so named roles (e.g. a crit band styled in the theme) come from the theme while ad-hoc groups (five hosts) take a colour here without minting a theme role. The single styling channel still holds: this is the stack's one colour input.

    column?: string

    Name of the numeric value column for the bar height (single series). Provide column or columns, not both.

    columns?: readonly string[]

    Stacked-segment columns, bottom → top — one segment per name. Use with a wide series (e.g. pivotByGroup output) or with bins. Mutually exclusive with column, and invalid with a Map series (there the segments are the map's groups; use column).

    gap?: number

    Pixel gap between adjacent bars / bins — the bar's key span is inset by this total (half each side). Omitted ⇒ the theme's bar gap. A span the gap would invert collapses to the style's minWidth.

    id?: string

    The stable series identity for selection + hover — and it gates interactivity (a bar layer is selectable/hoverable only when given an id). For a stack, a clicked / hovered segment is identified by (id, key = bin begin, label = group), so two segments in one bin don't both light up.

    index?: number

    Declaration position among the <Layers> children, injected by Layers so z-order follows JSX order. Do not set.

    ordinal?: boolean

    For bins: lay the bands out as uniform unit slots ([i, i+1]) instead of their numeric [start, end] edges — an ordinal band axis where every band reads the same width (heart-rate zones). Ignored for series.

    orientation?: Orientation

    Bar growth direction (the histogram orientation). Default 'vertical'.

    • 'vertical' — bars grow up from a value baseline, bins on the x axis (time buckets, value bands). The column / time-histogram look.
    • 'horizontal' — bars grow right, bins on the y axis (a band axis like heart-rate zones). Label the bands with <YAxis ticks={[{ at, label }]}>.

    A 'horizontal' chart puts the value on the shared x axis, so its container's x-kind is 'value' — it cannot share a <ChartContainer> with time-series rows (each horizontal histogram stands alone). Vertical charts have no such constraint. The in-chart flag / crosshair value cursor is drawn for the single-series vertical case only; stacked and horizontal charts read out via hover / click (onHover / onSelect).

    series?: TimeSeries<S> | ValueSeries<VS> | ReadonlyMap<string, TimeSeries<S>>

    The source series. Provide exactly one of series or bins.

    • A TimeSeries (interval / timeRange-keyed is the primary form — each event's key [begin, end] is a bar's x-span; a point-keyed series derives its width from neighbour spacing) → single-series bars via column, or stacked bars from a wide series via columns.
    • A ValueSeries (series.byValue('dist')) bars against its value axis.
    • A ReadonlyMap<group, TimeSeries> — one series per stack group, all on the same bin grid, the shape series.partitionBy('host', { groups }).aggregate(seq, m).toMap() returns. Stacked bars, column names the shared value column, groups = map order.

    Live charts: series.byValue(…) / .toMap() mint fresh objects each call, so an inline series={…} re-registers this layer every render — on a frequently re-rendering chart, memoize the projection (useMemo).