TerraFluent.Chart.Reporting

Pie Chart in C#

Render pie charts in C# with AsPie and Add — outside labels with connector lines, legend placement, self-contained SVG. TerraFluent.Chart.Reporting, MIT.

Pie Chart

Pie chart with legend showing market share by vendor.

Market Share by Vendor — Global — Q4 2025 Market Share by Vendor — Global — Q4 2025 — Series: Market Share. Categories: TerraFluent, Competitor A, Competitor B, Others. Values range from 14 to 38. Market Share by Vendor Global — Q4 2025 38% 27% 21% 14% TerraFluent: 38 Competitor A: 27 Competitor B: 21 Others: 14 TerraFluent Competitor A Competitor B Others terrafluent.dev terrafluent.dev

Pie — Label Placement

DataLabelRadius: inside, at edge, and outside with connector.

Pie — Data Label Placement — DataLabelRadius: 0.6 (inside) · 1.0 (edge) · 1.25 (outside + connector) Pie — Data Label Placement — DataLabelRadius: 0.6 (inside) · 1.0 (edge) · 1.25 (outside + connector) — Series: Share. Categories: North America to Rest of World. Values range from 7 to 38. Pie — Data Label Placement DataLabelRadius: 0.6 (inside) · 1.0 (edge) · 1.25 (outside + connector) 38% 24% 20% 11% 7% North America: 38 Europe: 24 Asia-Pacific: 20 Lat. America: 11 Rest of World: 7 North America Europe Asia-Pacific Lat. America Rest of World terrafluent.dev terrafluent.dev

When to use a pie chart

Reach for it when

  • Parts of a single whole that genuinely sums to 100% — market share, budget allocation.
  • Three to six slices. Past that the small slices become indistinguishable wedges.
  • When "roughly half" or "about a quarter" is the takeaway, not a precise ranking.

Use something else when

  • Comparing slices of similar size. Humans compare angles badly; a bar chart makes the same comparison exact.
  • Values that do not sum to a whole, or that can be negative.
  • Change over time. Two pies side by side are far harder to read than one column or line chart.

Pie Chart in C#

Lifted verbatim from the chart types reference, so it compiles against the shipped API. See the API reference for every overload and the exact data types each series method accepts.

// Pie
string svg = ChartBuilder.Create()
    .AsPie()
    .Title("Market Share by Vendor")
    .Size(600, 440)
    .Labels("TerraFluent","Competitor A","Competitor B","Others")
    .Legend(l => l.AtBottom())
    .AsAnimated()
    .Series(s => s
        .Add("Market Share", new double[] { 38, 27, 21, 14 },
            cfg => cfg.DataLabel.Show().Radius(1.2).Format("{value}%")))
    .RenderToSvg();

Install

dotnet add package TerraFluent.Chart.Reporting
  • MIT licensed — free for commercial use, no chart limits, no watermarks.
  • Zero dependencies — nothing but the .NET base class library.
  • netstandard2.0 through net10.0 — .NET Framework 4.6.1+, .NET Core 2.0+, and every modern release.
  • Output is one SVG string — embed it in HTML, a PDF, or a Word document.