bar

Configuration Structure

bar: {
horizontal: boolean,
columnWidth: string | number,
barHeight: string | number,
distributed: boolean,
borderRadius: number,
borderRadiusApplication: 'around' | 'end',
borderRadiusWhenStacked: 'all' | 'last',
rangeBarOverlap: boolean,
rangeBarGroupRows: boolean,
isDumbbell: boolean,
dumbbellColors: string[][],
dumbbell: ApexPlotOptionsDumbbell,
connector: { ... },
color: string,
opacity: number,
dataLabels: { ... },
enabled: boolean,
offset: number,
colorFromMarker: boolean,
formatter: Function,
style: { ... },
fontSize: string,
fontFamily: string,
fontWeight: string | number,
colors: string[],
tooltip: { ... },
differenceLabel: string,
isFunnel: boolean,
isFunnel3d: boolean,
colors: { ... },
ranges: Array,
from: number,
to: number,
color: string,
backgroundBarColors: string[],
backgroundBarRadius: number,
dataLabels: { ... },
maxItems: number,
hideOverflowingLabels: boolean,
position: string,
orientation: 'horizontal' | 'vertical',
total: { ... },
enabled: boolean,
formatter: Function,
offsetX: number,
offsetY: number,
style: { ... },
color: string,
fontSize: string,
fontFamily: string,
fontWeight: number | string,
}

horizontal

Default: false

Transforms column charts into horizontal bar charts.

borderRadius

Default: 0

Creates rounded corners on bars/columns. Available since v3.26.0.

borderRadiusApplication

Default: 'around'

Specifies whether to apply rounding around both ends or only to a single end.

borderRadiusWhenStacked

Default: 'all'

Which segments of a stack round. Stacked bar and column charts only, and only when borderRadius is above 0.

  • all (default) caps both ends of the stack: the baseline end and the far end.
  • last caps only the far end, so the stack sits square on the baseline.

A rounded corner belongs to the outside of a stack, so either way the segments sandwiched in the middle stay square. A stack is a series group, not the whole chart, so a grouped stacked chart resolves its outermost segments per group.

plotOptions: {
  bar: {
    borderRadius: 6,
    borderRadiusWhenStacked: 'last'
  }
}

Version history. This option existed before v7.0, was removed in v7.0, and came back in v7.4 with the semantics above. If you read the 7.0 migration guide and deleted it, it is safe to set again on 7.4 or later. On 7.0 through 7.3 the option is ignored and corner ownership always follows the stack's outer edge, which is what all does now.

columnWidth

Default: '70%'

Percentage of available grid width occupied by columns. Range: 0% to 100%.

barHeight

Default: '70%'

Percentage of available grid height for horizontal bars. Range: 0% to 100%.

distributed

Default: false

Enables discrete bar mode where each value represents one bar per series.

rangeBarOverlap

Default: true

In timeline charts, enables bars to overlap instead of stacking.

rangeBarGroupRows

Default: false

In multi-series timeline charts, groups horizontal rows together rather than stacking them vertically.

hideZeroBarsWhenGrouped

Default: false

Prevents zero-value bars from occupying space in non-stacked grouped configurations.

isDumbbell

Default: false

Adds dots at starting and ending points of range bars.

dumbbellColors

Default: undefined

Endpoint colours for the y: [low, high] form, per series: [[startColor, endColor]].

chart.type: 'dumbbell' with one series per measure takes its colours from colors instead, so that each dot is coloured after the series it belongs to.

dumbbell

Available since v7.1.0. Applies to chart.type: 'dumbbell', and to any range bar drawn with isDumbbell.

The connector's thickness is barHeight (rows) or columnWidth (columns), and the size of the marked ends is markers.size: they are the bar and its markers, so they are configured as such. Only what is specific to the comparison lives here.

plotOptions: {
  bar: {
    barHeight: 6,
    dumbbell: {
      connector: { opacity: 0.55 },
      dataLabels: { enabled: true },
      tooltip: { differenceLabel: 'Change' }
    }
  }
}

connector

bar.dumbbell.connector

The line joining the marked ends.

color

bar.dumbbell.connector.color
Default: undefined

A solid colour for the join.

Left undefined, the connector is a gradient between the two endpoint colours, resolved per row so that a row where the measures cross still runs the right way.

opacity

bar.dumbbell.connector.opacity
Default: 0.55

Connector opacity. The join is context for the two marked ends, not a third mark competing with them.

dataLabels

bar.dumbbell.dataLabels

A value written at each end of the connector, in that end's own colour.

Default on for chart.type: 'dumbbell' (the pair of numbers is the comparison, and reading them off an axis costs the glance the chart was meant to save), off for the bare isDumbbell flag on a range bar.

With three or more measures only the two extremes are labelled. Anything between them sits on the connector, where a label has nowhere to go that is not over the line or over its neighbour.

enabled

bar.dumbbell.dataLabels.enabled
Default: false

Whether to write a value at each marked end.

offset

bar.dumbbell.dataLabels.offset
Default: 6

Clearance from the marked end, in px, outward from the connector.

colorFromMarker

bar.dumbbell.dataLabels.colorFromMarker
Default: true

When true, each label takes its own end's colour, so a value is tied to a measure by more than its position. Set false to colour them all through dumbbell.dataLabels.style.colors.

formatter

bar.dumbbell.dataLabels.formatter
Default: undefined

Formats one endpoint value. Receives (value, { seriesIndex, dataPointIndex, endpointIndex, w }), where endpointIndex says which measure the end belongs to.

It defaults to the value axis' own label formatter, not dataLabels.formatter. On a range bar that one reads out end - start, which is the gap rather than an endpoint.

plotOptions: {
  bar: {
    dumbbell: {
      dataLabels: {
        formatter: function (val) {
          return val + '%'
        }
      }
    }
  }
}

style

bar.dumbbell.dataLabels.style

Typography for the end labels.

fontSize

bar.dumbbell.dataLabels.style.fontSize
Default: '12px'

Font size for the end labels.

fontFamily

bar.dumbbell.dataLabels.style.fontFamily
Default: undefined

Font family for the end labels. Falls back to chart.fontFamily.

fontWeight

bar.dumbbell.dataLabels.style.fontWeight
Default: 600

Font weight for the end labels.

colors

bar.dumbbell.dataLabels.style.colors
Default: undefined

Label colours, indexed by endpoint. Used only when dumbbell.dataLabels.colorFromMarker is false.

tooltip

bar.dumbbell.tooltip

Tooltip wording specific to the dumbbell readout.

differenceLabel

bar.dumbbell.tooltip.differenceLabel
Default: 'Difference'

Names the gap between two endpoints, which is the reason the two dots are on one row.

The row appears only when exactly two endpoints are visible; with three or more, "the difference" names nothing.

isFunnel

Default: false

Activates funnel chart mode.

isFunnel3d

Default: true

Applies 3D shadow effects to funnel chart bars.

ranges

bar.colors.ranges

Defines color mappings for specific value ranges.

colors: {
    ranges: [{
        from: 0,
        to: 10,
        color: '#FF0000'
    }]
}

backgroundBarColors

bar.colors.backgroundBarColors

Custom background colors for bar rectangles.

backgroundBarOpacity

bar.colors.backgroundBarOpacity

Transparency level for background bar colors.

backgroundBarRadius

bar.colors.backgroundBarRadius

Border radius for background bar rectangles.

position

bar.dataLabels.position

Label placement options: top, center, or bottom.

maxItems

bar.dataLabels.maxItems

Maximum displayable data-labels on the chart.

hideOverflowingLabels

bar.dataLabels.hideOverflowingLabels

Hides overlapping labels in stacked charts.

orientation

bar.dataLabels.orientation

Label orientation: horizontal or vertical.

enabled

bar.dataLabels.total.enabled

Displays cumulative values in stacked configurations.

formatter

bar.dataLabels.total.formatter

Custom formatting for total values.

dataLabels: {
    total: {
        formatter: function (val, opts) {
            return opts.w.globals.seriesTotals[opts.dataPointIndex]
        }
    }
}

offsetX

bar.dataLabels.total.offsetX

Left positioning adjustment for total label.

offsetY

bar.dataLabels.total.offsetY

Vertical positioning adjustment for total label.

color

bar.colors.ranges.color

ForeColor of total label. Default: #373d3f.

fontSize

bar.dataLabels.total.style.fontSize

FontSize for total label. Default: 12px.

fontFamily

bar.dataLabels.total.style.fontFamily

FontFamily for total label.

fontWeight

bar.dataLabels.total.style.fontWeight

Font-weight for total label. Default: 600.