TerraFluent.Chart.Reporting

Column Chart in C#

Generate column charts in C# with AddColumn — grouped, stacked, and 100% stacked, rendered as self-contained SVG with no JavaScript dependency.

Column Chart

Single-series column chart — product sales by category.

Product Sales by Category — FY 2025 Annual Totals Product Sales by Category — FY 2025 Annual Totals — Series: Units Sold. Categories: Electronics to Toys. Values range from 2.8k to 8.4k. Product Sales by Category FY 2025 Annual Totals 0 2k 4k 6k 8k Units Sold Electronics Clothing Books Home Sports Toys Category Units Sold: 8.4k Units Sold: 5.2k Units Sold: 3.1k Units Sold: 6.7k Units Sold: 4.3k Units Sold: 2.8k Units Sold terrafluent.dev terrafluent.dev

When to use a column chart

Reach for it when

  • Comparing a value across a modest number of discrete categories — the default choice, and usually the right one.
  • {"Time buckets that are genuinely discrete"=>"months, quarters, sprints."}
  • Grouped or stacked composition where each category's parts sum to something meaningful.

Use something else when

  • More than about fifteen categories, or long category names — switch to a horizontal bar chart, which has room for the labels.
  • A truncated Y axis. Column length is the encoding, so a non-zero baseline misstates the comparison.
  • Continuous data sampled densely; use a line chart.

Column 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.

// Single series
string svg = ChartBuilder.Create()
    .Title("Product Sales by Category")
    .Size(700, 420)
    .XAxis("Category", "Electronics","Clothing","Books","Home","Sports","Toys")
    .YAxis("Units Sold", min: 0)
    .AsAnimated()
    .Series(s => s
        .AddColumn("Units Sold",
            new double[] { 8400, 5200, 3100, 6700, 4300, 2800 }))
    .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.