pie

Configuration Structure

pie: {
startAngle: number,
endAngle: number,
customScale: number,
offsetX: number,
offsetY: number,
expandOnClick: boolean,
dataLabels: { ... },
offset: number,
minAngleToShowLabel: number,
external: { ... },
show: boolean,
offsetX: number,
offsetY: number,
fontSize: string,
fontFamily: string,
fontWeight: string | number,
color: string,
formatter: Function,
connector: { ... },
show: boolean,
width: number,
color: string,
length: number,
gap: number,
donut: { ... },
size: string,
background: string,
labels: { ... },
show: boolean,
name: { ... },
show: boolean,
fontSize: string,
fontFamily: string,
fontWeight: string | number,
color: string,
offsetY: number,
formatter: Function,
value: { ... },
show: boolean,
fontSize: string,
fontFamily: string,
fontWeight: string | number,
color: string,
offsetY: number,
formatter: Function,
total: { ... },
show: boolean,
showAlways: boolean,
fontFamily: string,
fontWeight: string | number,
fontSize: string,
label: string,
color: string,
formatter: Function,
}

plotOptions

size

pie.donut.size

Deprecated: This property is no longer available.

startAngle

Default: 0

A custom angle from which the pie/donut slices should start.

endAngle

Default: 360

A custom angle to which the pie/donut slices should end.

expandOnClick

Default: true

When clicked on the pie/donut slice, expand the slice to make it distinguished visually.

offsetX

Default: 0

Sets the left offset of the whole pie area

offsetY

Default: 16

Sets the top offset of the whole pie area

customScale

Default: 1

Transform the scale of whole pie/donut overriding the default calculations. Try variations like 0.5 and 1.5 to see how it scales based on the default width/height of the pie

dataLabels

offset

pie.dataLabels.offset

Offset by which labels will move outside / inside of the donut area

minAngleToShowLabel

pie.dataLabels.minAngleToShowLabel

Minimum angle to allow data-labels to show. If the slice angle is less than this number, the label would not show to prevent overlapping issues.

All additional formatting/styling settings for dataLabels has to be done in [dataLabels](/docs/options/datalabels/) configuration.

external

pie.dataLabels.external

Render each slice's name outside the pie, joined to the slice by a leader line, so the chart reads without cross-referencing the legend. The percentage keeps rendering inside the slice. Applies to pie and donut only (ignored for polarArea, where the radial length already encodes the value).

plotOptions: {
  pie: {
    dataLabels: {
      external: {
        show: true,
        connector: {
          show: true,
          length: 16
        }
      }
    }
  }
}

show

pie.dataLabels.external.show
Default: false

Turn the external labels on. Off by default, so existing pie/donut charts keep their inside labels.

offsetX

pie.dataLabels.external.offsetX
Default: 0

Horizontal shift applied to every external label.

offsetY

pie.dataLabels.external.offsetY
Default: 0

Vertical shift applied to every external label.

fontSize

pie.dataLabels.external.fontSize

Font size of the external label. Falls back to dataLabels.style.fontSize when unset.

fontFamily

pie.dataLabels.external.fontFamily

Font family of the external label. Falls back to dataLabels.style.fontFamily when unset.

fontWeight

pie.dataLabels.external.fontWeight

Font weight of the external label. Falls back to dataLabels.style.fontWeight when unset.

color

pie.dataLabels.external.color

Text colour of the external label. Defaults to chart.foreColor so the label stays readable against the page background.

formatter

pie.dataLabels.external.formatter

Build the label text. Receives the slice name and an options object { seriesIndex, percent, value, w }. Return a string for a single line, or an array of strings to stack multiple lines, for example [name, percent + '%'].

connector

pie.dataLabels.external.connector

The leader line drawn from the slice edge to the external label.

show

pie.dataLabels.external.connector.show
Default: true

Draw the leader line. When off, labels sit outside the slice with no connecting line.

width

pie.dataLabels.external.connector.width
Default: 1

Stroke width of the leader line, in pixels.

color

pie.dataLabels.external.connector.color

Colour of the leader line. Defaults to the slice colour.

length

pie.dataLabels.external.connector.length
Default: 16

Length of the horizontal run of the leader line after the radial elbow, in pixels.

gap

pie.dataLabels.external.connector.gap
Default: 6

Gap between the slice edge and the start of the leader line, in pixels.

size

pie.donut.size

Donut / ring size in percentage relative to the total pie area.

background

pie.donut.background

The background color of the pie

labels

pie.donut.labels

Donut chart labels

show

pie.donut.labels.show

Whether to display inner labels or not.

name

pie.donut.labels.name

show

pie.donut.labels.name.show

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

fontSize

pie.donut.labels.name.fontSize

FontSize of the name in donut's label

fontFamily

pie.donut.labels.name.fontFamily

FontFamily of the name in donut's label

fontWeight

pie.donut.labels.name.fontWeight

Font-weight of the name in dataLabel

color

pie.donut.labels.name.color

Color of the name in the donut's label

offsetY

pie.donut.labels.name.offsetY

Sets the top offset for name

formatter

pie.donut.labels.name.formatter

A custom formatter function to apply on the name text in dataLabel

value

pie.donut.labels.value

show

pie.donut.labels.value.show

Show the value label associated with the name label

fontSize

pie.donut.labels.value.fontSize

FontSize of the value label

fontFamily

pie.donut.labels.value.fontFamily

FontFamily of the value label

fontWeight

pie.donut.labels.value.fontWeight

Font weight of the value label in dataLabel

color

pie.donut.labels.value.color

Color of the value label in dataLabel

offsetY

pie.donut.labels.value.offsetY

Sets the top offset for value label

formatter

pie.donut.labels.value.formatter

A custom formatter function to apply on the value label in dataLabel

total

pie.donut.labels.total

show

pie.donut.labels.total.show

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

showAlways

pie.donut.labels.total.showAlways

Always show the total label and do not remove it even when user clicks/hovers over the slices.

label

pie.donut.labels.total.label

Label for "total". Defaults to "Total"

fontSize

pie.donut.labels.total.fontSize

FontSize of the total label

fontFamily

pie.donut.labels.total.fontFamily

FontFamily of the total label

fontWeight

pie.donut.labels.total.fontWeight

font-weight of the total label in dataLabel

color

pie.donut.labels.total.color

Color of the total label

formatter

pie.donut.labels.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 a total of all series percentage divided by the length of series.