radialBar
Configuration Structure
radialBar: {}inverseOrder
falseWhether to make the first value of series innermost or outermost
startAngle
0Angle from which the radialBars should start
endAngle
360Angle to which the radialBars should end. The sum of the startAngle and endAngle should not exceed 360.
The dial always runs clockwise from startAngle. When startAngle is larger than endAngle, the track, value arc, needle, ticks and bands all sweep clockwise from startAngle across the same span, so swapping the two angles moves the dial rather than reversing it.
offsetX
Sets the left offset for radialBars
offsetY
Sets the top offset for radialBars
shape
'arc'Available since v5.12.0. Sub-shape used when rendering a gauge (chart.type: 'gauge'). Both shapes honor bands and ticks independently.
Available Options:
- arc (default): fills a colored value-arc proportional to the series value, mirroring the classic radialBar look.
- needle: replaces the value-arc with a rotating pointer/needle. Use together with
needleandpivotto style the indicator.
min
0Value-to-angle mapping (lower bound) for both radialBar and gauge. Defaults to 0. Override together with max to use a custom domain (e.g. min: 0, max: 240 for a speedometer). The value arc, needle, ticks and bands all share this domain.
A value outside min to max is drawn at the nearest bound, so a reading below zero needs a negative min to show.
On any domain other than the default 0 to 100, the default value and total labels print the plain number without a %.
max
100Value-to-angle mapping (upper bound). Defaults to 100.
bands
Threshold bands rendered as colored arc segments along the gauge arc. Each band spans [from, to] in the gauge's min..max domain and is filled with color. Useful for showing healthy / warning / critical zones.
plotOptions: {
radialBar: {
bands: [
{ from: 0, to: 50, color: '#00E396', label: 'Healthy' },
{ from: 50, to: 80, color: '#FEB019', label: 'Warning' },
{ from: 80, to: 100, color: '#FF4560', label: 'Critical' }
]
}
}
bandsStyle
Styling applied to all bands.
strokeWidth
'40%'Width of the band arc. Accepts a percentage string (e.g. '97%') relative to the stroke width of the value arc.
gap
0Gap between adjacent bands. A number or a '4px' string is pixels along the arc, so it takes a smaller angle on a larger gauge. Since 8.5.0 two units keep the same look at every size: '1%' is a share of the min..max scale and '1.5deg' is an angle.
A band narrower than the gap is not drawn, and the chart warns once in the console naming it.
Before 8.1.0 the gap was applied in value units, so a gap tuned on an older version draws at a different width now: thinner on a 0 to 100 dial, wider on a domain that spans many more units. Re-tune it in pixels.
hideTrackWhenPresent
When true, the background track is hidden if at least one band is defined. The bands then act as the visual track.
linecap
How the ends of each band arc are drawn. Available options: butt, round, square.
targets
Available since v8.5.0. Marks at a value on a ring: a target, a limit, last period's reading. They are drawn over the rings and bands, turned to their value around the dial's centre, and animated with the chart (in with the ring on mount, from the old value on a data update). Targets work on every ring of a radialBar and on both gauge shapes, and change with updateOptions.
Targets are an add-on outside the default bundle, free to use. Import apexcharts/features/radial-targets, or add dist/features/radial-targets.js after apexcharts.js on a script-tag page. apexcharts.full.min.js includes it. Without the add-on the dial draws without targets and warns once in the console.
import ApexCharts from 'apexcharts'
import 'apexcharts/features/radial-targets'
new ApexCharts(el, {
chart: { type: 'radialBar', height: 320 },
series: [72, 54],
labels: ['Sales', 'Support'],
plotOptions: {
radialBar: {
targets: [
{ value: 85, seriesIndex: 0, label: { text: 'Goal' } },
{ value: 60, seriesIndex: 1, shape: 'triangle' }
]
}
}
}).render()
To read where the dial was drawn, for example to place your own overlay, call getRadialScales().
value
Where the mark sits, in the min..max domain (clamped to it). Pass 'series' to follow the ring's own value, which draws a pointer on the rim. A missing or non-numeric value draws nothing.
seriesIndex
The ring the mark sits on, by series index. Defaults to 0.
shape
'line' (default), 'triangle' or 'circle'.
position
'across' draws the mark across the ring's centre line. 'outside' and 'inside' put it off the ring's outer or inner edge (on a needle gauge with no value arc, off the bands' edge). A triangle points at the ring. Defaults to 'across', or 'outside' for a triangle.
length
Extent along the radius: pixels, or a percentage string such as '130%' of the ring's thickness. It is a line's length, a triangle's height or a circle's diameter. Defaults to '130%' for a line and 10 for the other shapes.
width
Extent across the radius in pixels: a line's stroke width or a triangle's base. A circle ignores it. Defaults to 3 for a line and 12 for a triangle.
color
The mark's colour. Defaults to chart.foreColor, so it follows the theme.
strokeColor
Outline of a triangle or circle, for example so it reads over a band of its own colour.
strokeWidth
Outline width. Defaults to 0.
label
Text drawn off the mark's outer end (its inner end with position: 'inside'). It stays upright at every angle.
text
The label text.
offset
Pixels between the mark and the text. Defaults to 4.
style
Font of the label.
fontSize
Font size of the label.
fontFamily
Font family of the label.
fontWeight
Font weight of the label.
color
Text colour. Defaults to the target's color.
cssClass
A class added to the target's apexcharts-radial-target group.
id
Keeps a target's identity across updates, so when the list is reordered it moves from where it was. Without an id, targets match by position in the array.
ticks
Tick marks rendered along the gauge arc. Independent of bands and works for both arc and needle shapes.
show
Show or hide all tick marks.
major
Major (large) tick marks. Typically used to highlight round numbers in the gauge domain.
count
Number of major tick marks to render across the arc.
length
Length of each major tick mark in pixels.
width
Stroke width of each major tick mark.
color
Color of major tick marks.
placement
Where to draw the major tick marks relative to the gauge arc. Available options: inside, outside.
minor
Minor (small) tick marks rendered between major ticks.
count
Number of minor tick marks between each pair of major ticks.
length
Length of each minor tick mark in pixels.
width
Stroke width of each minor tick mark.
color
Color of minor tick marks.
placement
Where to draw the minor tick marks relative to the gauge arc. Available options: inside, outside.
labels
Numeric labels rendered alongside major ticks.
show
Show or hide tick labels.
offset
Distance between each label and its tick mark.
fontSize
Font-size for tick labels.
fontFamily
Font-family for tick labels.
fontWeight
Font-weight for tick labels.
color
Color for tick labels.
formatter
A custom formatter that receives the tick's domain value and returns the string to display.
ticks: {
labels: {
formatter: function (value) {
return value + ' km/h'
}
}
}
needle
Styling for the gauge needle. Only used when shape: 'needle'.
color
Fill color of the needle.
length
Length of the needle. Accepts a number (pixels) or a percentage string relative to the gauge radius (e.g. '85%').
baseWidth
Width of the needle at its base.
tipWidth
Width of the needle at its tip. Set lower than baseWidth for a tapered pointer.
showValueArc
falseWhen true, the filled value-arc is rendered alongside the needle (progress ring plus pointer indicator). When false (default), only the needle is drawn.
Available Options:
- false (default)
- true
offsetY
0Pixel offset of the needle's rotation center on the Y axis. Positive values push the base down (toward the chord midpoint of a ∩-shape partial-arc gauge); negative values push it up. The needle rotates around this shifted point.
animation
Controls the needle's sweep on the first render and when the gauge value changes.
enabled
trueEnable or disable needle animation. When false, the needle lands on its value at once. It also lands at once whenever the chart itself does not animate (chart.animations.enabled, and chart.animations.dynamicAnimation.enabled for updates).
duration
undefinedAnimation duration in milliseconds. When unset, the needle moves at the value arc's speed: chart.animations.speed on the first render and chart.animations.dynamicAnimation.speed on updates, so the needle and the arc arrive together. Set it to give the needle its own speed for both.
easing
Accepted but not read. The needle settles with a slight overshoot on the first render and eases out without overshoot on updates. Use duration to change how long the sweep takes.
margin
Spacing which will be subtracted from the available hollow size
size
Size in percentage relative to the total available size of chart
background
Background color for the hollow part of the radialBars
image
Optional image URL which can be displayed in the hollow area.
imageWidth
Width of the hollow image
imageHeight
Height of the hollow image
imageOffsetX
Sets the left offset of hollow image
imageOffsetY
Sets the top offset of hollow image
imageClipped
If true, the image doesn't exceeds the hollow area and is contained within.
position
Available Options
- front
- back
stroke
undefinedStroke color drawn around the hollow ring. Combine with strokeDasharray to produce a dashed indicator circle around the value text.
strokeWidth
1Stroke width in pixels of the hollow ring border. Only applied when stroke is set.
strokeDasharray
undefinedSVG stroke-dasharray pattern applied to the hollow ring border. Accepts a single number (uniform dashes), a string of comma/space-separated lengths (e.g. '4 2') or, since 8.5.0, an array of lengths.
dropShadow
enabled
Enable a dropshadow for paths of the SVG
top
Set top offset for shadow
left
Set left offset for shadow
blur
Set blur distance for shadow
opacity
Set the opacity of shadow.
color
Color of the dropshadow
track
show
Show track under the bar lines.
startAngle
Angle from which the track should start.
endAngle
Angle to which the track should end.
background
Color of the track. If you want different color for each track, you can pass an array of colors.
strokeWidth
Width of the track
opacity
Opacity of the track
margin
Spacing between each track
dropShadow
enabled
Enable a dropshadow for the track
top
Set top offset for track shadow
left
Set left offset for track shadow
blur
Set blur distance for track shadow
opacity
Opacity of the track shadow
color
Color of the track dropshadow
dataLabels
show
Whether to display labels inside radialBars or not
name
show
Show the name of the respective bar associated with it's value
fontSize
FontSize of the name in dataLabel
fontFamily
FontFamily of the name in dataLabel
fontWeight
Font-weight of the name in dataLabel
color
Color of the name in dataLabel
offsetY
Sets the top offset for name
formatter
A custom formatter that receives the series name and returns the string to display as the name label.
dataLabels: {
name: {
formatter: function (seriesName) {
return seriesName.toUpperCase()
}
}
}
value
show
Show the value label associated with the name label
fontSize
FontSize of the value label in dataLabel
fontFamily
fontFamily of the value label in dataLabel
fontWeight
Font weight of the value label in dataLabel
color
Color of the value label in dataLabel
offsetY
Sets the top offset for value label
formatter
A custom formatter function to apply on the value label in dataLabel. It receives the series value and w.
The default formatter appends % on the default 0 to 100 domain, and prints the plain value when min or max is set to anything else.
total
show
Show the total of all the series in the inner area of radialBar
label
Label for "total". Defaults to "Total"
color
Color of the total label
fontSize
Font-size of the total label in dataLabel
fontFamily
font-family of the total label in dataLabel
fontWeight
font-weight of the total label in dataLabel
formatter
A custom formatter function to apply on the total value. It accepts one parameter w which contains the chart's config and global objects.
Defaults to the average of the series values (their sum divided by the number of series), followed by % on the default 0 to 100 domain only.
barLabels
enabled
When using custom angles in a radial bar chart, you can use this option. Here's a demo using this option
offsetX
Left offset of the labels
offsetY
Top offset of the labels
useSeriesColors
Whether to use primary colors or not.
fontSize
Sets the font-size of legend text elements
fontFamily
Sets the font-family of legend text elements
fontWeight
Sets the font-weight of legend text elements
formatter
A custom formatter function to modify the label text
onClick
Fire an event when the label is clicked
from
Start of the band, in the gauge's min to max domain.
to
End of the band, in the same domain.
color
Fill colour of the band's arc segment.
label
Optional label for the band, for use in a legend or tooltip.