Charts / Pie chart

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

Replied: 38 (38%)Awaiting review: 24 (24%)Closed: 19 (19%)Blocked: 12 (12%)Draft: 7 (7%)
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

Replied: 61 (61%)Awaiting review: 27 (27%)Blocked: 12 (12%)
Replied61%
Awaiting review27%
Blocked12%

API

NameTypeDefaultDescription
dataChartSlice[]—Label and value per slice. Past six, the tail is grouped into “Other”.
sizenumber220viewBox size; the radius is half of it less 6.
sortbooleantrueLargest 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 / ariaLabelstring—Head and the svg label; every slice's figure is appended to the label.
emptyTitle / emptyTextstring—chart__empty when nothing has a value.