# Requests by region and intake channel · Radial Column

Preview

![Requests by region and intake channel](categorical-radial-area-compact-light.png)

![Requests by region and intake channel](categorical-radial-area-compact-dark.png)

390 × 520 pixels

## Create this example

Create a console project, add the ChartForgeX package, and replace Program.cs with this source. Run it to write SVG, PNG and HTML with the default system fonts.

For the same typography as the gallery, [download the gallery-font recipe](categorical-radial-area-compact-light.gallery.csharp.txt) and copy the gallery’s fonts directory beside your program.

```
#region Setup
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using ChartForgeX;
using ChartForgeX.Core;
using ChartForgeX.Primitives;
using ChartForgeX.Rendering;
using ChartForgeX.Themes;
using ChartForgeX.Topology;
using ChartForgeX.Typography;
using ChartForgeX.VisualArtifacts;
using ChartForgeX.VisualBlocks;

var mode = ThemeMode.Light;
var theme = VisualTheme.Graphite();
var model = CategoricalRadialAreaRecipe.Create("compact", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(390, 520)), theme, mode,
    new VisualFrame("Requests by region and intake channel", "Sector area measures the visible interval while source observations retain their values", showLegend: null, showSurface: false));
var prepared = model.Prepare(context);
File.WriteAllText("visual.svg", prepared.ToSvg());
File.WriteAllBytes("visual.png", prepared.ToPng());
File.WriteAllText("visual.html", prepared.ToArtifact("example", VisualArtifactKind.Chart).ToHtmlPage());
#endregion

/// <summary>Uses the existing categorical radial column owner for grouped or stacked sector-area measurements.</summary>
public static class CategoricalRadialAreaRecipe {
    /// <summary>Creates native categorical columns with an explicit area or radius encoding and stable source IDs.</summary>
    /// <param name="variant">Use wide, compact, stacked, compact-stacked, radius or compact-radius.</param>
    /// <param name="mode">The paired visual theme mode.</param>
    /// <returns>A complete chart ready for the ordinary SVG, PNG and HTML output workflow.</returns>
    public static Chart Create(string variant = "wide", ThemeMode mode = ThemeMode.Light) {
        if (variant is not ("wide" or "compact" or "stacked" or "compact-stacked" or "radius" or "compact-radius"))
            throw new ArgumentOutOfRangeException(nameof(variant));
        var compact = variant.StartsWith("compact", StringComparison.Ordinal);
        var stacked = variant.EndsWith("stacked", StringComparison.Ordinal);
        var radius = variant.EndsWith("radius", StringComparison.Ordinal);
        var completed = Values("completed", "Completed", new[] { 25d, 80, 0, 45 });
        var followup = Values("follow-up", "Follow-up", new[] { 15d, 25, 20, 30 });
        if (stacked) { completed.StackGroup("requests"); followup.StackGroup("requests"); }
        // Zero baseline makes nominal sector area proportional to the source value. A nonzero
        // visible minimum encodes only the displayed interval; gaps/corners are separate paint.
        return Chart.Create().Size(compact ? 390 : 900, compact ? 520 : 600)
            .Theme(VisualTheme.Graphite()).ThemeMode(mode).Title("Requests by region and intake channel")
            .XAxis(x => x.Title("Region")).YAxis(y => y.Title("Requests")).XLabels("North", "South", "East", "West")
            .YAxis(y => y.Bounds(0, 120)).Legend().DataLabels(false)
            .ValueFormat(ChartValueFormat.Number("0' requests'"))
            .RadialGeometry(new ChartRadialGeometryOptions(-90, 270, .12, .12, .08,
                valueEncoding: radius ? ChartRadialValueEncoding.Radius : ChartRadialValueEncoding.Area))
            .AddSeries(completed).AddSeries(followup);
    }

    private static ChartSeries Values(string key, string name, double[] values) {
        var points = values.Select((value, index) => new ChartPoint(index + 1, value)).ToArray();
        var series = new ChartSeries(new ChartSeriesId(key), name, ChartSeriesKind.RadialColumn, points);
        var ids = new[] { "north", "south", "east", "west" };
        for (var index = 0; index < ids.Length; index++) series.ObservationId(index, new ChartObservationId(ids[index]));
        return series;
    }
}
```

```
#region Setup
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using ChartForgeX;
using ChartForgeX.Core;
using ChartForgeX.Primitives;
using ChartForgeX.Rendering;
using ChartForgeX.Themes;
using ChartForgeX.Topology;
using ChartForgeX.Typography;
using ChartForgeX.VisualArtifacts;
using ChartForgeX.VisualBlocks;

var mode = ThemeMode.Dark;
var theme = VisualTheme.Graphite();
var model = CategoricalRadialAreaRecipe.Create("compact", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(390, 520)), theme, mode,
    new VisualFrame("Requests by region and intake channel", "Sector area measures the visible interval while source observations retain their values", showLegend: null, showSurface: false));
var prepared = model.Prepare(context);
File.WriteAllText("visual.svg", prepared.ToSvg());
File.WriteAllBytes("visual.png", prepared.ToPng());
File.WriteAllText("visual.html", prepared.ToArtifact("example", VisualArtifactKind.Chart).ToHtmlPage());
#endregion

/// <summary>Uses the existing categorical radial column owner for grouped or stacked sector-area measurements.</summary>
public static class CategoricalRadialAreaRecipe {
    /// <summary>Creates native categorical columns with an explicit area or radius encoding and stable source IDs.</summary>
    /// <param name="variant">Use wide, compact, stacked, compact-stacked, radius or compact-radius.</param>
    /// <param name="mode">The paired visual theme mode.</param>
    /// <returns>A complete chart ready for the ordinary SVG, PNG and HTML output workflow.</returns>
    public static Chart Create(string variant = "wide", ThemeMode mode = ThemeMode.Light) {
        if (variant is not ("wide" or "compact" or "stacked" or "compact-stacked" or "radius" or "compact-radius"))
            throw new ArgumentOutOfRangeException(nameof(variant));
        var compact = variant.StartsWith("compact", StringComparison.Ordinal);
        var stacked = variant.EndsWith("stacked", StringComparison.Ordinal);
        var radius = variant.EndsWith("radius", StringComparison.Ordinal);
        var completed = Values("completed", "Completed", new[] { 25d, 80, 0, 45 });
        var followup = Values("follow-up", "Follow-up", new[] { 15d, 25, 20, 30 });
        if (stacked) { completed.StackGroup("requests"); followup.StackGroup("requests"); }
        // Zero baseline makes nominal sector area proportional to the source value. A nonzero
        // visible minimum encodes only the displayed interval; gaps/corners are separate paint.
        return Chart.Create().Size(compact ? 390 : 900, compact ? 520 : 600)
            .Theme(VisualTheme.Graphite()).ThemeMode(mode).Title("Requests by region and intake channel")
            .XAxis(x => x.Title("Region")).YAxis(y => y.Title("Requests")).XLabels("North", "South", "East", "West")
            .YAxis(y => y.Bounds(0, 120)).Legend().DataLabels(false)
            .ValueFormat(ChartValueFormat.Number("0' requests'"))
            .RadialGeometry(new ChartRadialGeometryOptions(-90, 270, .12, .12, .08,
                valueEncoding: radius ? ChartRadialValueEncoding.Radius : ChartRadialValueEncoding.Area))
            .AddSeries(completed).AddSeries(followup);
    }

    private static ChartSeries Values(string key, string name, double[] values) {
        var points = values.Select((value, index) => new ChartPoint(index + 1, value)).ToArray();
        var series = new ChartSeries(new ChartSeriesId(key), name, ChartSeriesKind.RadialColumn, points);
        var ids = new[] { "north", "south", "east", "west" };
        for (var index = 0; index < ids.Length; index++) series.ObservationId(index, new ChartObservationId(ids[index]));
        return series;
    }
}
```

<!-- PowerForge markdown artifact sha256:C6899A377989B8EED6E0DAF582AAB18F5E73F16542471C71708BD74CEF927181 -->
