Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Footer
  • MenuNew
  • Navbar
  • On This PageNew
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Button
  • Checkbox
  • Color Picker
    • Date
    • Date Range
    • Datetime
    • Datetime Range
    • Time
    • Time Range
  • File Upload
  • NumericNew
  • Radio Button
  • RatingNew
  • Select
  • Slider
  • Switch
  • Textfield
  • Alert
  • Avatar
  • Chip
  • Icon
  • Progress
  • Skeleton
  • Spinner
  • TooltipNew
  • Data Table
  • Pagination
  • Pick List
  • BarcodeNew
  • QR CodeNew
  • CalendarNew
  • Table
  • Overview
  • Area
  • Bar
  • Box Plot
  • Bullet
  • Bump
  • Candlestick
  • Column
  • Dot Plot
  • Dumbbell
  • Funnel
  • Gantt
  • Gauge
  • Heatmap
  • Histogram
  • Icon
  • Line
  • Lollipop
  • Matrix
  • Nightingale
  • Parallel Coordinates
  • Pie
  • Quadrant
  • Radar
  • Radial Bar
  • Range
  • Scatter
  • Slope
  • Small Multiples
  • Strip Plot
  • Treemap
  • Waffle
  • Waterfall
  • Arc Diagram
  • Barcode
  • Beeswarm
  • Bump Area
  • Categorical Scatter
  • Chord Diagram
  • Circular Treemap
  • Contour
  • Convex Treemap
  • Density Plot
  • Dendrogram
  • Euler Diagram
  • Flowchart
  • Hexagonal Binning
  • Horizon
  • Marimekko
  • Network Diagram
  • Radial Histogram
  • Ridgeline
  • Sankey
  • Stream Graph
  • Sunburst
  • Venn Diagram
  • Violin Plot
  • Word Cloud
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Charts

TwSunburstChart

TwSunburstChart is a Blazor sunburst chart: a tree drawn as rings, each segment sized by its share of the whole.

Last updated 18 October 2026

Please be aware this component is new, may have bugs and/or be subject to change. Please report any bugs at https://github.com/twblazor/twblazor/issues.

Basic usage

TwSunburstChart draws a tree of ChartHierarchyNode values as rings. The top-level nodes form the inner ring and each node's children sit around it in the next ring out, every segment sized by its share of the whole.
Sales by region and productThousands of pounds
  • North
  • South
NorthHardwareSoftwareSouthHardwareSoftware
NorthValue 62Share 58.5%
North / HardwareValue 38Share 35.8%
North / SoftwareValue 24Share 22.6%
SouthValue 44Share 41.5%
South / HardwareValue 28Share 26.4%
South / SoftwareValue 16Share 15.1%
RAZOR
<TwChart Title="Sales by region and product" Description="Thousands of pounds">
    <TwSunburstChart Roots="@_sales" />
</TwChart>
CSHARP
@code {
    private readonly ChartHierarchyNode[] _sales =
    [
        new("North", Children: [new("Hardware", 38), new("Software", 24)]),
        new("South", Children: [new("Hardware", 28), new("Software", 16)])
    ];
}

Three rings

Each top-level node has its own color and its descendants are lighter tints of it, so a branch reads as one family all the way out. A larger Height leaves more segments room for their names.
Website visits by channel, source and device
  • Search
  • Social
  • Direct
SearchOrganicMobileDesktopPaidMobileDesktopSocialVideoMobilePostsMobileDesktopDirectMobileDesktop
SearchVisits 10,000Share 51.3%
Search / OrganicVisits 7,300Share 37.4%
Search / Organic / MobileVisits 4,200Share 21.5%
Search / Organic / DesktopVisits 3,100Share 15.9%
Search / PaidVisits 2,700Share 13.8%
Search / Paid / MobileVisits 1,800Share 9.2%
Search / Paid / DesktopVisits 900Share 4.6%
SocialVisits 5,200Share 26.7%
Social / VideoVisits 3,000Share 15.4%
Social / Video / MobileVisits 2,600Share 13.3%
Social / Video / DesktopVisits 400Share 2.1%
Social / PostsVisits 2,200Share 11.3%
Social / Posts / MobileVisits 1,500Share 7.7%
Social / Posts / DesktopVisits 700Share 3.6%
DirectVisits 4,300Share 22.1%
Direct / MobileVisits 1,900Share 9.7%
Direct / DesktopVisits 2,400Share 12.3%
RAZOR
<TwChart Title="Website visits by channel, source and device">
    <TwSunburstChart Roots="@_visits" LabelHeader="Segment" ValueHeader="Visits" Height="ChartHeight.Large" />
</TwChart>
CSHARP
@code {
    private readonly ChartHierarchyNode[] _visits =
    [
        new("Search", Children:
        [
            new("Organic", Children: [new("Mobile", 4200), new("Desktop", 3100)]),
            new("Paid", Children: [new("Mobile", 1800), new("Desktop", 900)])
        ]),
        new("Social", Children:
        [
            new("Video", Children: [new("Mobile", 2600), new("Desktop", 400)]),
            new("Posts", Children: [new("Mobile", 1500), new("Desktop", 700)])
        ]),
        new("Direct", Children: [new("Mobile", 1900), new("Desktop", 2400)])
    ];
}

Uneven branches

Branches need not be the same depth. A node without children simply ends at its own ring, leaving the rings beyond it empty.
Monthly household spendingPounds
  • Housing
  • Food
  • Transport
  • Savings
HousingRentFoodGroceriesEating outRailCarSavings
HousingValue ¤1,375Share 49.7%
Housing / RentValue ¤1,150Share 41.6%
Housing / EnergyValue ¤180Share 6.5%
Housing / WaterValue ¤45Share 1.6%
FoodValue ¤650Share 23.5%
Food / GroceriesValue ¤420Share 15.2%
Food / Eating outValue ¤230Share 8.3%
Food / Eating out / LunchesValue ¤90Share 3.3%
Food / Eating out / DinnersValue ¤140Share 5.1%
TransportValue ¤340Share 12.3%
Transport / RailValue ¤210Share 7.6%
Transport / CarValue ¤130Share 4.7%
SavingsValue ¤400Share 14.5%
RAZOR
<TwChart Title="Monthly household spending" Description="Pounds">
    <TwSunburstChart Roots="@_spending" ValueFormat="C0" />
</TwChart>
CSHARP
@code {
    private readonly ChartHierarchyNode[] _spending =
    [
        new("Housing", Children: [new("Rent", 1150), new("Energy", 180), new("Water", 45)]),
        new("Food", Children: [new("Groceries", 420), new("Eating out", Children: [new("Lunches", 90), new("Dinners", 140)])]),
        new("Transport", Children: [new("Rail", 210), new("Car", 130)]),
        new("Savings", 400)
    ];
}

When to use

Use a sunburst chart to show shares at every level of a tree. Names that do not fit are cut short or left off. Nodes with no value are left out.

Summary

Tooltips and the table view give the path and the value of each segment. Tooltips also give its share of the whole. The arrow keys visit a segment, then its children, then the next segment.

Shared features

The legend, tooltips, keyboard navigation, table view, value formatting, height and empty state work the same on every chart. See TwChart for those options.

Keyboard navigation

The plot is a single Tab stop. Each data point is announced with its series and value as focus reaches it, and the table view presents the same data without the plot.
Key What it does
Tab Moves focus into the plot, onto the data point last visited.
Arrow Right or Arrow Down Moves to the next data point.
Arrow Left or Arrow Up Moves to the previous data point.
Home or End Moves to the first or last data point.
Escape Hides the tooltip of the focused data point.
Enter or Space On a legend item: shows or hides that series. On the table button: switches between the chart and its data table.

On this page

  • Basic usage
  • Three rings
  • Uneven branches
  • When to use
  • Summary
  • Shared features
  • Keyboard navigation
Discord (opens in a new tab) • GitHub (opens in a new tab) • Documentation (opens in a new tab) • MIT License (opens in a new tab) • llms.txt (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload