API / Series/Bar-X / BarXSeries

Defined in: src/core/types/chart/bar-x.ts:63

Extends

Type Parameters

Type Parameter Default type
T MeaningfulAny

Properties

Property Type Description
barMaxWidth? number Maximum bar thickness in pixels. Must be a finite number greater than or equal to 1. Inherits series.options['bar-x'].barMaxWidth (default 50). Stacks use the smallest resolved limit, including hidden series. Applied after barPadding; the minimum rendered thickness is 1 pixel. Minimum 1
barPadding? number Padding as a fraction of the allocated bar slot. Larger values make thinner bars, centered in the same slot. Must be a finite number in [0, 1]. Inherits series.options['bar-x'].barPadding (default 0.2). Stacks use the largest resolved padding among all their series, including hidden ones. Padding is applied before barMaxWidth and minimum thickness limits. Minimum 0 Maximum 1
borderColor? string The border color. Defaults to var(--gcharts-shape-border-color).
borderRadius? number The corner radius at the value end of each bar, in pixels. For stacks, only the outer ends of the positive and negative stacks are rounded. Default 0
borderWidth? number The width of the border in pixels, drawn inside each bar. Ignored in the range slider and when the bar width or height is at most twice the border width. Default 0
color? string The main color of the series (hex, rgba)
cursor? string You can set the cursor to "pointer" if you have click events attached to the series, to signal to the user that the points and lines can be clicked.
custom? any A reserved subspace to store options and values for customized functionality Here you can add additional data for your own event callbacks and formatter callbacks
data BarXSeriesData<T>[] -
dataLabels? Omit<BaseDataLabels, "format"> & BarSeriesDataLabelPlacementOptions & object & object Options for the series data labels, appearing next to each data point.
grouping? boolean Whether to place bars or stacks side by side. When false, bars share the category center without taking up grouped slots. Stacking within each stackId is preserved; non-stacked bars start at the value-axis baseline. All series in the same stack must use the same grouping value; omitted grouping means true. Set false on all series in a stack to overlay the whole stack. Later series cover earlier ones, including their borders. Default true
legend? BaseSeriesLegend & object Individual series legend options. Has higher priority than legend options in widget data
name string The name of the series (used in legend, tooltip etc)
nullMode? "skip" | "zero" Specifies how null or undefined values should be handled in the series. - 'skip': Omit data points with null values (no bar shown) - 'zero': Treat null values as zero Default 'skip'
opacity? null | number Opacity of the bar fill and border. Does not affect normal data labels. Point opacity takes precedence. Omitted or null values inherit series.options['bar-x'].opacity (default 1). The inactive state's opacity multiplies the resolved bar opacity. Minimum 0 Maximum 1
rangeSlider? ChartSeriesRangeSliderOptions Options to configure how this series appears and behaves in the Range Slider component.
stackId? string This option allows grouping series in a stacked chart
stacking? "percent" | "normal" Whether to stack the values of each series on top of each other. Possible values are undefined to disable, "normal" to stack by value or "percent" Percent stacking supports only non-negative values.
stackLabels? StackLabelsOptions<T> Override plugin stack label options. Only enabled series contribute to totals.
tooltip? Omit<{ enabled: boolean; valueFormat: ValueFormat<CustomFormatContext>; }, "valueFormat"> & object Options for the tooltip that appears when the user hovers over a series or point.
type "bar-x" Bar-X series: vertical columns for values along the X axis.
visible? boolean Initial visibility of the series
yAxis? number Y-axis index (when using two axes)