A Radial Bar Series, also called Circular Bar, visualises data through rectangular bars arranged along a polar axis.
Simple Radial Bar
To create a Radial Bar Series, use the radial-bar
series type.
series: [
{ type: 'radial-bar', radiusKey: 'quarter', angleKey: 'software', angleName: 'Software' },
{ type: 'radial-bar', radiusKey: 'quarter', angleKey: 'hardware', angleName: 'Hardware' },
{ type: 'radial-bar', radiusKey: 'quarter', angleKey: 'services', angleName: 'Services' },
],
In this configuration:
radiusKey
is set to 'quarter', which is the shared category for the Radius Axis.angleKey
specifies the numerical datasets, 'software', 'hardware' and 'services', for the Angle Axis.angleName
labels each series, such as 'Software', 'Hardware' and 'Services'.
Stacked Radial Bar
In a Stacked Radial Bar chart, bars are horizontally stacked within each category to represent a cumulative total, allowing analysis of both single data points and overall category totals.
To stack bars in a Radial Bar Series, enable the stacked
series property.
series: [
{ type: 'radial-bar', radiusKey: 'quarter', angleKey: 'software', stacked: true },
{ type: 'radial-bar', radiusKey: 'quarter', angleKey: 'hardware', stacked: true },
{ type: 'radial-bar', radiusKey: 'quarter', angleKey: 'services', stacked: true },
],
Customisation
Inner Radius
The inner radius can be used to create a 'donut' effect.
This is changed via the innerRadiusRatio
option on the Radius Category Axis.
axes: [
{ type: 'angle-number' },
{ type: 'radius-category' innerRadiusRatio: 0.3 },
],
Any value between 0
and 1
will set the inner radius as a proportion of the overall radius.
Category Padding
The following options are used to control the padding between different elements on the Radius Axis:
paddingInner
: Gap between bar groups, ranges from0
(no gap) to1
(maximum spacing).groupPaddingInner
: Spacing within a group, ranges from0
(bars touching) to1
(widest gap).
axes: [
{ type: 'angle-number', groupPaddingInner: 0.5, paddingInner: 0.5 },
{ type: 'radius-category', groupPaddingInner: 0.5, paddingInner: 0.5 },
],
Axis Label Orientation
To change Angle Axis Label orientation, use the label.orientation
property with these options:
fixed
: Labels have fixed orientation (default).parallel
: Labels align parallel to the axis.perpendicular
: Labels align perpendicular to the axis.
The following configuration changes the orientation of the Axis Labels to parallel
:
axes: [
{
type: 'angle-number',
label: {
orientation: 'parallel',
},
},
{ type: 'radius-category' },
],
Axis Angles
To change Angle Axis circumference, use the startAngle
and endAngle
properties. To change the Radius Axis start angle, use positionAngle
property.
axes: [
{
type: 'angle-number',
startAngle: 270,
endAngle: 450,
},
{
type: 'radius-category',
positionAngle: 270,
},
],
API Reference
Properties available on the AgRadialBarSeriesOptions
interface.
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.
The data to use when rendering the series. If this is not supplied, data must be set on the chart instead.
Configuration for marker and series highlighting when a series or legend item is hovered over.
A human-readable description of the angle values. If supplied, this will be passed to the tooltip renderer as one of the parameters.
A human-readable description of the radius values. If supplied, this will be passed to the tooltip renderer as one of the parameters.
Properties available on the AgAngleNumberAxisOptions
interface.
Properties available on the AgRadiusCategoryAxisOptions
interface.
The ratio of the inner radius of the axis as a proportion of the overall radius.
Used to create an inner circle.
This property is for grouped polar series plotted on a radius category axis.
It is a proportion between 0 and 1 which determines the size of the gap between the items within a single group along the angle axis.
This property is for grouped polar series plotted on a radius category axis.
It is a proportion between 0 and 1 which determines the size of the gap between the groups of items along the angle axis.
This property is for grouped polar series plotted on a radius category axis.
It is a proportion between 0 and 1 which determines the size of the gap between the groups of items along the angle axis.