Skip to content

Type Alias: BasePieTrace ​

ts
type BasePieTrace = Omit<CommonTraceAttributes, 'hoverinfo'> & DomainTraceAttributes & object;

Pie or donut: slices of a circle proportional to their values.

Type Declaration ​

NameTypeDescription
direction?"clockwise" | "counterclockwise"Direction in which slices follow each other. The first slice always has an edge at the starting angle (12 o'clock for rotation: 0).
dlabel?numberLabel step, see label0.
hole?numberFraction of the radius cut out of the middle: a donut chart when > 0. Range: 0 – 1
hoverinfo?PerPoint< | "label" | "text" | "value" | "percent" | "name" | `${"label" | "text" | "value" | "percent" | "name"}+${string}` | "all" | "none" | "skip">Which fields hover labels show, in a fixed order; 'skip' also turns hover events off for this trace. Default 'all'.
insidetextfont?PieTraceInsidetextfontFont of labels inside slices. Defaults to textfont, with a color contrasting the slice.
insidetextorientation?"horizontal" | "radial" | "tangential" | "auto"Orientation of inside labels: horizontal, radial (along the radius), tangential (across it), or auto (whichever is largest).
label0?numberWithout labels: numeric labels label0 + i·dlabel (only used when values is set).
labels?DataColumnSlice labels. Slices with the same label are merged: their values are summed (or occurrences counted without values), and other per-slice attributes use the first non-empty entry.
marker?PieTraceMarkerSlice style.
outsidetextfont?PieTraceOutsidetextfontFont of labels outside slices. Defaults to textfont.
pull?PerPointNumberFraction of the radius slices are pulled out from the center, one value for all slices or one per slice. Range: 0 – 1
rotation?numberStarting angle in degrees, clockwise from 12 o'clock.
scalegroup?stringPies with the same non-empty scale group are sized by their totals: their areas are proportional to the sums of their values.
sort?booleanOrder slices from largest to smallest.
text?DataColumnText per slice, shown on the slice with the text flag of textinfo, and in hover labels unless hovertext is set.
textfont?PieTraceTextfontFont of slice labels. Defaults to layout.font.
textinfo?| "label" | "text" | "value" | "percent" | `${"label" | "text" | "value" | "percent"}+${string}` | "none"What slice labels show, in a fixed order (label, text, value, percent), one per line. Default 'percent', or 'text+percent' when text is an array. Use texttemplate for other layouts.
textposition?PerPoint<"inside" | "outside" | "auto" | "none">Where slice labels go: inside (shrunk to fit), outside (next to the slice, moved apart to avoid overlaps, with leader lines when moved), auto (inside when it fits unshrunk, else outside), none.
texttemplate?PerPoint<string | number>Template for slice labels, overriding textinfo: %{label}, %{value}, %{percent}, %{text}, %{color}, %{customdata}, %{meta}, with optional d3 formats (%{percent:.1%}). Without a format, value and percent are formatted like textinfo.
title?PieTraceTitleThe pie title.
type"pie"Trace type.
values?DataColumnSlice values. Non-numeric entries are skipped; merged slices whose total is negative are dropped. Without values every label counts 1.

Released under the MIT License.