# Allocation through the team hierarchy · Sunburst

Preview

![Allocation through the team hierarchy](family-sunburst-curved-labels-light.png)

![Allocation through the team hierarchy](family-sunburst-curved-labels-dark.png)

800 × 440 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](family-sunburst-curved-labels-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 = SunburstCurvedLabelsRecipe.Create("curved-labels", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(800, 440)), theme, mode,
    new VisualFrame("Allocation through the team hierarchy", "", 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>Places complete supported primary names on captured native circular lanes without changing hierarchy allocation.</summary>
public static class SunburstCurvedLabelsRecipe {
    /// <summary>Creates the source model for a compact or wide consumer, independently of the export backend.</summary>
    public static Chart Create(string variant = "curved-labels", ThemeMode mode = ThemeMode.Light) {
        if (variant is not ("curved-labels" or "compact-curved-labels")) throw new ArgumentOutOfRangeException(nameof(variant));
        var chart = Chart.Create().Legend(false).DataLabels().TransparentBackground(false)
            .AddSunburst("Regional allocation", new[] {
                new ChartHierarchyItem("all", "Allocation"),
                new ChartHierarchyItem("operations", "Operations and service delivery", "all"),
                new ChartHierarchyItem("engineering", "Engineering and platform ownership", "all"),
                new ChartHierarchyItem("reconciliation", "Regional reconciliation", "operations", 25),
                new ChartHierarchyItem("settlement", "Settlement operations", "operations", 25),
                new ChartHierarchyItem("automation", "Automation services", "engineering", 25),
                new ChartHierarchyItem("platform", "Platform operations", "engineering", 25)
            }).Sunburst(options => {
                options.CurvedLabels = true;
                options.SectorGap = 3;
                options.CornerRadius = 3;
                options.MinimumLabelFontSize = 11;
            });
        chart.Series[0].DataLabelStyle(style => style.FontSize(13));
        return chart;
    }
}
```

```
#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 = SunburstCurvedLabelsRecipe.Create("curved-labels", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(800, 440)), theme, mode,
    new VisualFrame("Allocation through the team hierarchy", "", 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>Places complete supported primary names on captured native circular lanes without changing hierarchy allocation.</summary>
public static class SunburstCurvedLabelsRecipe {
    /// <summary>Creates the source model for a compact or wide consumer, independently of the export backend.</summary>
    public static Chart Create(string variant = "curved-labels", ThemeMode mode = ThemeMode.Light) {
        if (variant is not ("curved-labels" or "compact-curved-labels")) throw new ArgumentOutOfRangeException(nameof(variant));
        var chart = Chart.Create().Legend(false).DataLabels().TransparentBackground(false)
            .AddSunburst("Regional allocation", new[] {
                new ChartHierarchyItem("all", "Allocation"),
                new ChartHierarchyItem("operations", "Operations and service delivery", "all"),
                new ChartHierarchyItem("engineering", "Engineering and platform ownership", "all"),
                new ChartHierarchyItem("reconciliation", "Regional reconciliation", "operations", 25),
                new ChartHierarchyItem("settlement", "Settlement operations", "operations", 25),
                new ChartHierarchyItem("automation", "Automation services", "engineering", 25),
                new ChartHierarchyItem("platform", "Platform operations", "engineering", 25)
            }).Sunburst(options => {
                options.CurvedLabels = true;
                options.SectorGap = 3;
                options.CornerRadius = 3;
                options.MinimumLabelFontSize = 11;
            });
        chart.Series[0].DataLabelStyle(style => style.FontSize(13));
        return chart;
    }
}
```

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