Charts
Pie chart
Part-to-whole at a glance: up to six slices, each a categorical slot, separated by a 2px gap in the surface.
import { EcoPieChart } from "vue-ecosphere"
Five slices
Always ship the legend with values: a pie without numbers asks the reader to estimate angles.
Requests by outcome
August, 100 requests
Replied38%
Awaiting review24%
Closed19%
Blocked12%
Draft7%
Three slices
Use it only when the question is “roughly how is this split” and the parts differ enough to see.
Three parts of a whole
The most a pie should carry without a legend
Replied61%
Awaiting review27%
Blocked12%
API
| Name | Type | Default | Description |
|---|---|---|---|
data | ChartSlice[] | — | Label and value per slice. Past six, the tail is grouped into “Other”. |
size | number | 220 | viewBox size; the radius is half of it less 6. |
sort | boolean | true | Largest first, clockwise from twelve o'clock. |
legendValue | "percent" | "value" | "percent" | The number beside each legend label. |
valueFormat | (v: number) => string | — | Formats values in the label and legend. |
title / subtitle / caption / ariaLabel | string | — | Head and the svg label; every slice's figure is appended to the label. |
emptyTitle / emptyText | string | — | chart__empty when nothing has a value. |