Skip to content

ECharts pie

Reusable interactive pie component for compact part-to-whole views, including donut and rose treatments within one stable component contract.

Purpose
Summarize a small named distribution as parts of a total.
Primitive
echarts.Pie
Kind
components.KindEChartsPie
Configuration
Label, Caption, typed Series and sectors, radii, rose mode, pad angle, size, options, and chart style.
Accessibility
Figure name comes from Label and Caption stays visible. Pair the canvas with exact values in text or a table.
Usage Example
@echarts.Pie(echarts.PieConfig{
  Label: "Incident states",
  Series: []echarts.PieSeries{{
    Name: "Incidents",
    InnerRadius: 32,
    OuterRadius: 72,
    Data: []echarts.PieData{
      {Name: "Open", Value: 12},
      {Name: "Resolved", Value: 28},
    },
  }},
})

Rendered defaults

A zero outer radius renders at 75%. A zero inner radius renders a full pie; set both radii for a donut. Rose mode remains off unless selected.