AG Studio Launch Week šŸš€šŸš€šŸš€ 28 Sep - 2 Oct 2026 šŸš€šŸš€šŸš€ Join now

JavaScript ChartsRange Bar Series

Version 14.2.0
Enterprise

A Range Bar Series uses vertical or horizontal bars to show the range between high and low values in data. This series type is commonly used to assess data stability or variability.

Simple Range Bar Copy Link

The Range Bar Series is created using the range-bar series type.

{
    series: [
        {
            type: 'range-bar',
            xKey: 'department',
            yLowKey: 'low',
            yHighKey: 'high',
        },
    ],
}

The yLowKey and yHighKey are used to retrieve the range of values for the y-axis.

Multiple Range Bar Series Copy Link

Multiple Range Bar Series can be combined into a single chart.

{
    series: [
        {
            type: 'range-bar',
            xKey: 'date',
            yLowKey: 'start',
            yHighKey: 'gain',
            xName: 'Month',
            yLowName: 'Start',
            yHighName: 'End',
            yName: 'Gained',
        },
        {
            type: 'range-bar',
            xKey: 'date',
            yLowKey: 'loss',
            yHighKey: 'gain',
            xName: 'Month',
            yLowName: 'End',
            yHighName: 'Start',
            yName: 'Lost',
        },
    ],
}

In this configuration:

  • yName is used to control the text displayed in the legend.
  • yLowName, yHighName and xName are used to control the text displayed in the tooltip.

Missing Data Copy Link

The series handles missing or invalid data based on the presence or validity of xKey, yLowKey and yHighKey values in the data object.

When the axes types are continuous ('number', 'time' or 'log'), the yLowKey, yHighKey and xKey values in the data object are considered invalid if they are:

  • +/-Infinity
  • null
  • undefined
  • NaN

Data entries with invalid yLowKey, yHighKey and xKey values will result in gaps in the series.

Customisation Copy Link

Labels Copy Link

Series labels can be enabled using the label options.

{
    series: [
        {
            // ...
            label: {
                padding: 10,
                formatter: ({ itemType, value }) => {
                    return `Ā£${value.toFixed(0)}K ${itemType === 'low' ? '↓' : '↑'}`;
                },
            },
        },
    ],
}

In this configuration:

  • The yHighKey and yLowKey values for each data point are presented as labels via the label options.
  • The label.formatter function uses the itemType from the params object to distinguish whether the label is a low or high value.

Corner Radius Copy Link

The corner radius can be customised with the cornerRadius property.

{
    series: [
        {
            // ...
            cornerRadius: 10,
        },
    ],
}

Horizontal Range Bar Copy Link

To create a Horizontal Range Bar Series, set direction: 'horizontal'.

{
    series: [
        {
            type: 'range-bar',
            direction: 'horizontal',
            xKey: 'department',
            yLowKey: 'low',
            yHighKey: 'high',
        },
    ],
}

When the direction is 'horizontal' the xKey will determine categories on the y-axis, while the yLowKey and yHighKey will be used to provide numerical values along the x-axis.

Range Bar Chart Examples Copy Link

See more Range Bar Chart examples in the AG Charts Gallery.

API Reference Copy Link

Properties available on the AgRangeBarSeriesOptions interface.

type required 'range-bar'
Configuration for the Range Bar Series.
xKey required DatumKey
The key to use to retrieve x-values from the data.
yLowKey required DatumKey
The key to use to retrieve y-low-values from the data.
yHighKey required DatumKey
The key to use to retrieve y-high-values from the data.
xName string
A human-readable description of the x-values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters.
yName string
A human-readable description of the y-values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters.
yLowName string
A human-readable description of the y-low-values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters.
yHighName string
A human-readable description of the y-high-values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters.
legendItemName string
Human-readable description of the y-values. If supplied, matching items with the same value will be toggled together.
direction 'horizontal' | 'vertical'
Bar rendering direction. __Note:__ This option affects the layout direction of X and Y data values.
tooltip AgSeriesTooltip
Series-specific tooltip configuration.
label AgRangeBarSeriesLabelOptions
Configuration for the labels shown on top of data points.
shadow AgDropShadowOptions
Configuration for the shadow used behind the series items.
styler Styler
Function used to return formatting for entire series, based on the given parameters.
itemStyler Styler
Function used to return formatting for individual RangeBar series item cells, based on the given parameters.
highlight AgMultiSeriesHighlightOptions
Configuration for highlighting when a series or legend item is hovered over.
grouped boolean
Whether to group together (adjacently) separate bars.
segmentation AgSeriesSegmentation
Configuration for styling series as separate segments.
width PixelSize
Fixed width of each bar in the series.
widthRatio Ratio
Ratio of the bandwidth (or specified width) to use for the width for each bar in the series.
showInMiniChart boolean
Whether to include the series in the Mini Chart.
cursor string
The cursor to use for hovered markers. This config is identical to the CSS `cursor` property.
context ContextDefault
Context object to use in callbacks.
selection AgSelectionOptions
Configuration for data selection.
nodeClickRange InteractionRange
Range from a node that a click triggers the listener.
showInLegend boolean
Whether to include the series in the legend.
listeners AgSeriesListeners
A map of event names to event listeners.
cornerRadius PixelSize
Apply rounded corners to each bar.
fill AgColorType
The colour for filling shapes. A colour string, or an object for a gradient, pattern, or image fill.
fillOpacity Opacity
The opacity of the fill colour.
stroke AgCssColorOrRef
The colour for the stroke.
strokeWidth PixelSize
The width of the stroke in pixels.
strokeOpacity Opacity
The opacity of the stroke colour.
lineDash PixelSize[]
An array specifying the length in pixels of alternating dashes and gaps.
lineDashOffset PixelSize
The initial offset of the dashed line in pixels.
id string default: auto-generated value
Primary identifier for the series. This is provided as `seriesId` in user callbacks to differentiate multiple series. Auto-generated ids are subject to future change without warning, if your callbacks need to vary behaviour by series please supply your own unique `id` value.
data DatumDefault[]
The data to use when rendering the series. If this is not supplied, data must be set on the chart instead.
visible boolean
Whether to display the series.
xKeyAxis string default: 'x'
The key of the x-axis to which this series is bound.
yKeyAxis string default: 'y'
The key of the y-axis to which this series is bound.