radialBar

Configuration Structure

radialBar: {
inverseOrder: boolean,
startAngle: number,
endAngle: number,
offsetX: number,
offsetY: number,
shape: 'arc' | 'needle',
min: number,
max: number,
bands: Array,
bandsStyle: { ... },
strokeWidth: string,
gap: number | string,
hideTrackWhenPresent: boolean,
linecap: 'butt' | 'round' | 'square',
targets: ApexRadialTarget[],
value: number | 'series',
seriesIndex: number,
shape: 'line' | 'triangle' | 'circle',
position: 'across' | 'outside' | ...,
length: number | string,
width: number,
color: string,
strokeColor: string,
strokeWidth: number,
label: { ... },
text: string,
offset: number,
style: { ... },
fontSize: string,
fontFamily: string,
fontWeight: string | number,
color: string,
cssClass: string,
id: string | number,
ticks: { ... },
show: boolean,
major: { ... },
count: number,
length: number,
width: number,
color: string,
placement: 'inside' | 'outside',
minor: { ... },
count: number,
length: number,
width: number,
color: string,
placement: 'inside' | 'outside',
labels: { ... },
show: boolean,
offset: number,
fontSize: string,
fontFamily: string,
fontWeight: string | number,
color: string,
formatter: Function,
needle: { ... },
color: string,
length: string | number,
baseWidth: number,
tipWidth: number,
showValueArc: boolean,
offsetY: number,
animation: { ... },
enabled: boolean,
duration: number,
easing: string,
hollow: { ... },
margin: number,
size: string,
background: string,
image: string,
imageWidth: number,
imageHeight: number,
imageOffsetX: number,
imageOffsetY: number,
imageClipped: boolean,
position: 'front' | 'back',
stroke: string,
strokeWidth: number,
strokeDasharray: ApexDashPattern,
dropShadow: ApexDropShadow,
enabled: boolean,
top: number,
left: number,
blur: number,
opacity: number,
color: string | string[],
track: { ... },
show: boolean,
startAngle: number,
endAngle: number,
background: string | string[],
strokeWidth: string,
opacity: number,
margin: number,
dropShadow: ApexDropShadow,
enabled: boolean,
top: number,
left: number,
blur: number,
opacity: number,
color: string | string[],
dataLabels: { ... },
show: boolean,
name: { ... },
show: boolean,
fontFamily: string,
fontWeight: string | number,
fontSize: string,
color: string,
offsetY: number,
formatter: Function,
value: { ... },
show: boolean,
fontFamily: string,
fontSize: string,
fontWeight: string | number,
color: string,
offsetY: number,
formatter: Function,
total: { ... },
show: boolean,
label: string,
color: string,
fontFamily: string,
fontWeight: string | number,
fontSize: string,
formatter: Function,
barLabels: { ... },
enabled: boolean,
offsetX: number,
offsetY: number,
useSeriesColors: boolean,
fontFamily: string,
fontWeight: string | number,
fontSize: string,
formatter: Function,
onClick: Function,
}

inverseOrder

Default: false

Whether to make the first value of series innermost or outermost

startAngle

Default: 0

Angle from which the radialBars should start

endAngle

Default: 360

Angle 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

Default: '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 needle and pivot to style the indicator.

min

Default: 0

Value-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

Default: 100

Value-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

radialBar.bandsStyle.strokeWidth
Default: '40%'

Width of the band arc. Accepts a percentage string (e.g. '97%') relative to the stroke width of the value arc.

gap

radialBar.bandsStyle.gap
Default: 0

Gap 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

radialBar.bandsStyle.hideTrackWhenPresent

When true, the background track is hidden if at least one band is defined. The bands then act as the visual track.

linecap

radialBar.bandsStyle.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

radialBar.targets.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

radialBar.targets.seriesIndex

The ring the mark sits on, by series index. Defaults to 0.

shape

radialBar.targets.shape

'line' (default), 'triangle' or 'circle'.

position

radialBar.targets.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

radialBar.targets.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

radialBar.targets.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

radialBar.targets.color

The mark's colour. Defaults to chart.foreColor, so it follows the theme.

strokeColor

radialBar.targets.strokeColor

Outline of a triangle or circle, for example so it reads over a band of its own colour.

strokeWidth

radialBar.targets.strokeWidth

Outline width. Defaults to 0.

label

radialBar.targets.label

Text drawn off the mark's outer end (its inner end with position: 'inside'). It stays upright at every angle.

text

radialBar.targets.label.text

The label text.

offset

radialBar.targets.label.offset

Pixels between the mark and the text. Defaults to 4.

style

radialBar.targets.label.style

Font of the label.

fontSize

radialBar.targets.label.style.fontSize

Font size of the label.

fontFamily

radialBar.targets.label.style.fontFamily

Font family of the label.

fontWeight

radialBar.targets.label.style.fontWeight

Font weight of the label.

color

radialBar.targets.label.style.color

Text colour. Defaults to the target's color.

cssClass

radialBar.targets.cssClass

A class added to the target's apexcharts-radial-target group.

id

radialBar.targets.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

radialBar.ticks.show

Show or hide all tick marks.

major

radialBar.ticks.major

Major (large) tick marks. Typically used to highlight round numbers in the gauge domain.

count

radialBar.ticks.major.count

Number of major tick marks to render across the arc.

length

radialBar.ticks.major.length

Length of each major tick mark in pixels.

width

radialBar.ticks.major.width

Stroke width of each major tick mark.

color

radialBar.ticks.major.color

Color of major tick marks.

placement

radialBar.ticks.major.placement

Where to draw the major tick marks relative to the gauge arc. Available options: inside, outside.

minor

radialBar.ticks.minor

Minor (small) tick marks rendered between major ticks.

count

radialBar.ticks.minor.count

Number of minor tick marks between each pair of major ticks.

length

radialBar.ticks.minor.length

Length of each minor tick mark in pixels.

width

radialBar.ticks.minor.width

Stroke width of each minor tick mark.

color

radialBar.ticks.minor.color

Color of minor tick marks.

placement

radialBar.ticks.minor.placement

Where to draw the minor tick marks relative to the gauge arc. Available options: inside, outside.

labels

radialBar.ticks.labels

Numeric labels rendered alongside major ticks.

show

radialBar.ticks.labels.show

Show or hide tick labels.

offset

radialBar.ticks.labels.offset

Distance between each label and its tick mark.

fontSize

radialBar.ticks.labels.fontSize

Font-size for tick labels.

fontFamily

radialBar.ticks.labels.fontFamily

Font-family for tick labels.

fontWeight

radialBar.ticks.labels.fontWeight

Font-weight for tick labels.

color

radialBar.ticks.labels.color

Color for tick labels.

formatter

radialBar.ticks.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

radialBar.needle.color

Fill color of the needle.

length

radialBar.needle.length

Length of the needle. Accepts a number (pixels) or a percentage string relative to the gauge radius (e.g. '85%').

baseWidth

radialBar.needle.baseWidth

Width of the needle at its base.

tipWidth

radialBar.needle.tipWidth

Width of the needle at its tip. Set lower than baseWidth for a tapered pointer.

showValueArc

radialBar.needle.showValueArc
Default: false

When 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

radialBar.needle.offsetY
Default: 0

Pixel 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

radialBar.needle.animation

Controls the needle's sweep on the first render and when the gauge value changes.

enabled

radialBar.needle.animation.enabled
Default: true

Enable 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

radialBar.needle.animation.duration
Default: undefined

Animation 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

radialBar.needle.animation.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

radialBar.hollow.margin

Spacing which will be subtracted from the available hollow size

size

radialBar.hollow.size

Size in percentage relative to the total available size of chart

background

radialBar.hollow.background

Background color for the hollow part of the radialBars

image

radialBar.hollow.image

Optional image URL which can be displayed in the hollow area.

imageWidth

radialBar.hollow.imageWidth

Width of the hollow image

imageHeight

radialBar.hollow.imageHeight

Height of the hollow image

imageOffsetX

radialBar.hollow.imageOffsetX

Sets the left offset of hollow image

imageOffsetY

radialBar.hollow.imageOffsetY

Sets the top offset of hollow image

imageClipped

radialBar.hollow.imageClipped

If true, the image doesn't exceeds the hollow area and is contained within.

position

radialBar.hollow.position

Available Options

  • front
  • back

stroke

radialBar.hollow.stroke
Default: undefined

Stroke color drawn around the hollow ring. Combine with strokeDasharray to produce a dashed indicator circle around the value text.

strokeWidth

radialBar.hollow.strokeWidth
Default: 1

Stroke width in pixels of the hollow ring border. Only applied when stroke is set.

strokeDasharray

radialBar.hollow.strokeDasharray
Default: undefined

SVG 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

radialBar.hollow.dropShadow

enabled

radialBar.hollow.dropShadow.enabled

Enable a dropshadow for paths of the SVG

top

radialBar.hollow.dropShadow.top

Set top offset for shadow

left

radialBar.hollow.dropShadow.left

Set left offset for shadow

blur

radialBar.hollow.dropShadow.blur

Set blur distance for shadow

opacity

radialBar.hollow.dropShadow.opacity

Set the opacity of shadow.

color

radialBar.hollow.dropShadow.color

Color of the dropshadow

track

show

radialBar.track.show

Show track under the bar lines.

startAngle

radialBar.track.startAngle

Angle from which the track should start.

endAngle

radialBar.track.endAngle

Angle to which the track should end.

background

radialBar.track.background

Color of the track. If you want different color for each track, you can pass an array of colors.

strokeWidth

radialBar.track.strokeWidth

Width of the track

opacity

radialBar.track.opacity

Opacity of the track

margin

radialBar.track.margin

Spacing between each track

dropShadow

radialBar.track.dropShadow

enabled

radialBar.track.dropShadow.enabled

Enable a dropshadow for the track

top

radialBar.track.dropShadow.top

Set top offset for track shadow

left

radialBar.track.dropShadow.left

Set left offset for track shadow

blur

radialBar.track.dropShadow.blur

Set blur distance for track shadow

opacity

radialBar.track.dropShadow.opacity

Opacity of the track shadow

color

radialBar.track.dropShadow.color

Color of the track dropshadow

dataLabels

show

radialBar.dataLabels.show

Whether to display labels inside radialBars or not

name

radialBar.dataLabels.name

show

radialBar.dataLabels.name.show

Show the name of the respective bar associated with it's value

fontSize

radialBar.dataLabels.name.fontSize

FontSize of the name in dataLabel

fontFamily

radialBar.dataLabels.name.fontFamily

FontFamily of the name in dataLabel

fontWeight

radialBar.dataLabels.name.fontWeight

Font-weight of the name in dataLabel

color

radialBar.dataLabels.name.color

Color of the name in dataLabel

offsetY

radialBar.dataLabels.name.offsetY

Sets the top offset for name

formatter

radialBar.dataLabels.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

radialBar.dataLabels.value

show

radialBar.dataLabels.value.show

Show the value label associated with the name label

fontSize

radialBar.dataLabels.value.fontSize

FontSize of the value label in dataLabel

fontFamily

radialBar.dataLabels.value.fontFamily

fontFamily of the value label in dataLabel

fontWeight

radialBar.dataLabels.value.fontWeight

Font weight of the value label in dataLabel

color

radialBar.dataLabels.value.color

Color of the value label in dataLabel

offsetY

radialBar.dataLabels.value.offsetY

Sets the top offset for value label

formatter

radialBar.dataLabels.value.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

radialBar.dataLabels.total

show

radialBar.dataLabels.total.show

Show the total of all the series in the inner area of radialBar

label

radialBar.dataLabels.total.label

Label for "total". Defaults to "Total"

color

radialBar.dataLabels.total.color

Color of the total label

fontSize

radialBar.dataLabels.total.fontSize

Font-size of the total label in dataLabel

fontFamily

radialBar.dataLabels.total.fontFamily

font-family of the total label in dataLabel

fontWeight

radialBar.dataLabels.total.fontWeight

font-weight of the total label in dataLabel

formatter

radialBar.dataLabels.total.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

radialBar.barLabels.enabled

When using custom angles in a radial bar chart, you can use this option. Here's a demo using this option

offsetX

radialBar.barLabels.offsetX

Left offset of the labels

offsetY

radialBar.barLabels.offsetY

Top offset of the labels

useSeriesColors

radialBar.barLabels.useSeriesColors

Whether to use primary colors or not.

fontSize

radialBar.barLabels.fontSize

Sets the font-size of legend text elements

fontFamily

radialBar.barLabels.fontFamily

Sets the font-family of legend text elements

fontWeight

radialBar.barLabels.fontWeight

Sets the font-weight of legend text elements

formatter

radialBar.barLabels.formatter

A custom formatter function to modify the label text

onClick

radialBar.barLabels.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.