Type Alias: BasePieTrace
ts
type BasePieTrace = Omit<CommonTraceAttributes, 'hoverinfo'> & DomainTraceAttributes & object;Pie or donut: slices of a circle proportional to their values.
Type Declaration
| Name | Type | Description |
|---|---|---|
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? | number | Label step, see label0. |
hole? | number | Fraction 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? | PieTraceInsidetextfont | Font 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? | number | Without labels: numeric labels label0 + i·dlabel (only used when values is set). |
labels? | DataColumn | Slice 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? | PieTraceMarker | Slice style. |
outsidetextfont? | PieTraceOutsidetextfont | Font of labels outside slices. Defaults to textfont. |
pull? | PerPointNumber | Fraction of the radius slices are pulled out from the center, one value for all slices or one per slice. Range: 0 – 1 |
rotation? | number | Starting angle in degrees, clockwise from 12 o'clock. |
scalegroup? | string | Pies with the same non-empty scale group are sized by their totals: their areas are proportional to the sums of their values. |
sort? | boolean | Order slices from largest to smallest. |
text? | DataColumn | Text per slice, shown on the slice with the text flag of textinfo, and in hover labels unless hovertext is set. |
textfont? | PieTraceTextfont | Font 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? | PieTraceTitle | The pie title. |
type | "pie" | Trace type. |
values? | DataColumn | Slice values. Non-numeric entries are skipped; merged slices whose total is negative are dropped. Without values every label counts 1. |