Skip to content
ChartForgeX

Sunburst examples in C#

Sunburst examples rendered by ChartForgeX: a live chart, variants in light and dark themes, the C# source and the options to configure it.

All charts Parts of a wholeSunburst

Allocation through the team hierarchy

The interactive HTML page ChartForgeX writes for this chart. Hover for values, click legend items to hide or show series, use the keyboard to navigate, and right-click for export and reset. Where the chart can redraw a zoomed range, use the wheel to zoom, choose Pan to move the window, or choose Brush and drag to zoom to a range.

Build it in C#

This is the code for the chart above. Show setup adds the imports before it and the few lines that write SVG, PNG and HTML after it, so it reads as one program; the download is the complete console program, ready to run with the ChartForgeX package.

C# Program.cs Download
Loading source…

Variants

Options

Set these on chart.ConfigureSunburst(options => …). The full list is on the ChartSunburstOptions reference page.

OptionWhat it does
CurvedLabelsGets or sets whether complete primary captions may follow a measured circular lane. Default: false.
MinimumLabelFontSizeGets or sets the optional finite positive primary caption font-size floor in logical pixels. Default: null, retaining fixed-size captions.
SectorGapGets or sets the finite nonnegative minimum gap between painted Sunburst sector fills in logical pixels. Default: zero.
SecondaryLabelFormatterGets or sets the optional secondary caption formatter. Default: null.
SecondaryLabelStyleGets the secondary caption overrides. Inherits the node's data-label typography at 80% of its font size with a ten-pixel minimum no larger than the primary caption, then applies these overrides.
SecondaryLabelSpacingGets or sets the finite, nonnegative spacing in logical pixels between primary and secondary captions. Default: two.
CornerRadiusGets or sets the maximum inward corner radius in pixels for each Sunburst sector. Default: zero.
ParentValuePolicyGets or sets the group-size interpretation. Default: descendant leaf aggregation.