Series options
AreaSeriesOptions, BarLabelOptions, BarLabelPosition, BarSeriesOptions and 19 more: generated from the source of active-charts.
Exported by @workspace/. Generated from the package source; part of the index of every export.
Types#
interface AreaSeriesOptions extends SeriesOptionsBase {
type: 'area';
fill?: string;
fillOpacity?: number;
stroke?: string;
strokeWidth?: number;
gradient?: boolean;
stacked?: boolean;
stackedPercentage?: boolean;
stackGroup?: string;
marker?: MarkerOptions;
connectMissingData?: boolean;
curve?: CurveType;
label?: PointLabelOptions;
zones?: SeriesZones<ZoneRange>;
}The value labels of a bar series (T9): Label with the bar's four places. A label at 'inside- or 'inside- needs its length plus offset inside the bar along the value direction, and the label colour must read on the bar; otherwise fallback: 'auto' moves it outside (a stack segment's label is hidden instead) and 'hide' hides it. A stack segment's ends are its own, never the stack's: the stack's end carries stack.
interface BarLabelOptions extends Omit<LabelOptions, 'position'> {
position?: BarLabelPosition;
}Where a bar's value label goes (CF1, T9). 'outside' (default) beyond the bar's value end; 'inside' centred in the bar; 'inside- inside, against its VALUE end; 'inside- inside, against its BASE (zero, or the segment's own base on a stack). The ends are semantic: a negative bar's value end is the end its value points to, and a reversed axis keeps the roles, wherever the pixels put them.
type BarLabelPosition =
'inside' | 'outside' | 'inside-end' | 'inside-base';interface BarSeriesOptions extends SeriesOptionsBase, BarSizingOptions {
type: 'bar';
fill?: string;
stroke?: string;
paint?: DatumPaintResolver<DatumFill>;
cornerRadius?: number;
grouped?: boolean;
stacked?: boolean;
stackedPercentage?: boolean;
stackGroup?: string;
stackTotal?: StackTotalOptions;
errorBars?: ErrorBarOptions;
horizontal?: boolean;
label?: BarLabelOptions;
}How wide a bar draws across its category (CF1). Read by bar, waterfall and range-bar series. Both fields are optional; without them Active sizes the bars itself (a deliberate column, never a slab: W-VQ-3).
Bars shrink, they never overflow: a bar draws max where its share of the category has room for it, and narrower where it has not, down to one pixel; no bar is dropped and none draws wider than its share. On a chart with several bar series the bars of one category form one group, sized as a whole and centred; the first bar series that declares a field decides it for the group.
interface BarSizingOptions {
widthRatio?: number;
maxWidth?: number;
}Curve interpolation type for line/area series.
type CurveType =
'linear' | 'monotone' | 'catmullRom' | 'step' | 'stepBefore' | 'stepAfter';The labels of a mark with two ends (BC-LB1): a range bar, a range area or a dumbbell. Each end's label sits beyond that end, away from the other, whatever the axis direction, so a reversed axis never swaps their roles. The formatter's context names the end (role). Off by default.
interface EndpointLabelOptions extends PointLabelOptions {
endpoints?: 'both' | 'low' | 'high';
}Error bars of a series (T3): the uncertainty of each mark as two ABSOLUTE bounds read from the host's own columns, on the series' value axis. A symmetric source is the host's arithmetic (low = v − σ, high = v + σ).
- The whisker runs from the low to the high bound through the mark, with a cap at each drawn end, in the chart's neutral foreground ink (not the series colour): uncertainty never reads as another series. It follows its series' visibility and emphasis; it is no pointer or keyboard target of its own. There is no style option.
- Both bounds join the automatic value domain. An explicit
min/maxstill wins: the whisker is then cut at the plot edge without a cap, and the text still states the true bound. A bound a log axis cannot show (at or below 0) is drawn the same way. - The tooltip, the data table and the keyboard announcement read
value (low–high); one bound alone is named as the lower or upper bound. CSV and copy-as-table carry the raw bound columns after the value. The legend is unchanged. - A missing or non-finite bound draws the other side only; a low bound above the high bound draws no whisker (development diagnostic); a row without a value draws none.
- A series with error bars keeps every row: it is not reduced and it blocks time grouping (development diagnostic), because the bounds of an aggregate are not an aggregate of the bounds.
interface ErrorBarOptions {
lowKey: string;
highKey: string;
}Visual styling overrides for hover highlight states.
dimis the opacity this series steps back to while another item is addressed: it replaces the far context step for this series. Default: the far context step (0.64 light, 0.70 dark).Opacity brightnessis reserved for future use (active-series brightness boost).
interface HighlightStyleOptions {
dimOpacity?: number;
brightness?: number;
}What a bin's height is (T9). By default its amount: the count, or the sum or mean of y. area draws, for a count or a sum, the amount per narrowest bin width (amount × narrowest width / bin width), so a bar's AREA is proportional to its amount where bins differ in width; equal bins draw exactly the same either way. Labels, the tooltip value and the announcement keep the amount; the tooltip adds the drawn rate "per {narrowest width}". A mean is not additive over a width, so it takes no area.
type HistogramAmountOptions =
| {
aggregation?: 'count' | 'sum';
areaProportional?: boolean;
}
| {
aggregation: 'mean';
areaProportional?: false;
};The one bin rule of a histogram (T9): a target bin (default 10, round boundaries), a bin in x units (every bin that wide, on multiples of it; at most 1 000 bins, else the default applies with a development diagnostic), or explicit consecutive bins. Only one may be set; an untyped caller that sets several gets bins, then bin, then bin, with a development diagnostic. Every bin includes its lower bound; the last also its upper bound.
type HistogramBinRuleOptions =
| {
binCount?: number;
binWidth?: never;
bins?: never;
}
| {
binCount?: never;
binWidth: number;
bins?: never;
}
| {
binCount?: never;
binWidth?: never;
bins: [number, number][];
};type HistogramSeriesOptions = HistogramSeriesOptionsBase &
HistogramBinRuleOptions &
HistogramAmountOptions;interface LineSeriesOptions extends SeriesOptionsBase {
type: 'line';
stroke?: string;
strokeWidth?: number;
strokeOpacity?: number;
lineDash?: number[];
marker?: MarkerOptions;
connectMissingData?: boolean;
curve?: CurveType;
label?: PointLabelOptions;
errorBars?: ErrorBarOptions;
zones?: SeriesZones<LineZoneRange>;
}interface PieSeriesOptions {
type: 'pie' | 'donut';
valueKey: string;
categoryKey?: string;
name?: string;
id?: string;
innerRadius?: number;
outerRadius?: number;
padAngle?: number;
colors?: string[];
stroke?: string;
visible?: boolean;
showInLegend?: boolean;
highlightStyle?: HighlightStyleOptions;
animation?: boolean | SeriesAnimationOptions;
}Error bars of a scatter series (T3): the value-axis pair of Error and, on a numeric x axis, an x pair (both keys or neither), which joins the x domain and the x reading of the tooltip, table and announcement.
interface ScatterErrorBarOptions extends ErrorBarOptions {
xLowKey?: string;
xHighKey?: string;
}interface ScatterSeriesOptions extends SeriesOptionsBase {
type: 'scatter';
sizeKey?: string;
sizeRange?: [number, number];
sizeDomain?: readonly [number, number];
sizeName?: string;
fill?: string;
fillOpacity?: number;
stroke?: string;
strokeWidth?: number;
marker?: Pick<MarkerOptions, 'size' | 'shape'>;
label?: PointLabelOptions;
paint?: DatumPaintResolver<DatumPaint>;
errorBars?: ScatterErrorBarOptions;
}A series' own motion: only what a series owns, its entrance and its exit. Update, tooltip, attention and replay are the chart's. false turns both off for this series; reduced motion always wins.
interface SeriesAnimationOptions {
enabled?: boolean;
entrance?: boolean | SeriesEntranceMotionOptions;
exit?: boolean | ExitMotionOptions;
}A series' own entrance: the chart's entrance with a delay of its own.
interface SeriesEntranceMotionOptions {
enabled?: boolean;
duration?: number;
easing?: ChartMotionEasing;
type?: AnimationType;
delay?: number;
}A series <Chart> renders: the thirteen Cartesian types, each drawn by its registered plug-in. A pie, donut or heatmap is a family of its own (<Pie, <Heatmap); its options are not a <Chart> series.
type SeriesOptions =
| LineSeriesOptions
| AreaSeriesOptions
| BarSeriesOptions
| HistogramSeriesOptions
| ScatterSeriesOptions
| import('./candlestick-series-options').CandlestickSeriesOptions
| import('./ohlc-series-options').OhlcSeriesOptions
| import('./waterfall-series-options').WaterfallSeriesOptions
| import('./range-series-options').RangeAreaSeriesOptions
| import('./range-series-options').RangeBarSeriesOptions
| import('./range-series-options').DumbbellSeriesOptions
| import('./range-series-options').LollipopSeriesOptions
| import('./box-plot-series-options').BoxPlotSeriesOptions;interface SeriesOptionsBase {
type: SeriesType;
xKey: string;
yKey?: string;
name?: string;
id?: string;
valueSemantics?: ChartValueSemantics;
visible?: boolean;
showInLegend?: boolean;
yAxisId?: string;
highlightStyle?: HighlightStyleOptions;
animation?: boolean | SeriesAnimationOptions;
dataGrouping?: SeriesDataGroupingOverride | false;
}- Type
type SeriesType = Series Options['type'];
The series types a <Chart> renders: exactly the type of every Series member, each drawn by a series plug-in. A standalone family (pie, heatmap, treemap, …) or a scalar is a component of its own, never a <Chart> series, so it is no Series.
Resolves to "area" | "bar" | "box-.
What a stack total's formatter knows besides the number.
interface StackTotalFormatterContext {
readonly datum: ChartDatum;
readonly stackGroup?: string;
}One total label per stack and category: the net sum of the stack's visible members, the number the shared tooltip names as the stack's total. It sits beyond the end of the side its sign points to (above a positive vertical stack, below a negative one), in the one label colour. It has one place: a total that would leave the plot, or collide with another total, is hidden, and its value stays in the tooltip, the data table and the announcement. A percentage stack has no total (it always makes 100 %).
Declared on a member of the stack; the first member (in series order) that declares it sets the stack's total. Present means on, unless enabled: false.
interface StackTotalOptions extends Pick<
LabelOptions,
'enabled' | 'format' | 'fontSize' | 'color' | 'offset' | 'background'
> {
formatter?: (value: number, context?: StackTotalFormatterContext) => string;
}