A Sunburst Series is used to render hierarchical data structures or trees. Each node in the tree is represented by a segment on a radial circle, with the area of the sum of values.
 Simple Sunburst Copy Link  
The Sunburst Series is designed to display a single series and is created using the sunburst series type.
{
    series: [
        {
            type: 'sunburst',
            labelKey: 'name',
        },
    ],
}
The data passed in should be an array of nodes, with each node optionally containing children.
const data = [
    {
        name: 'Mariah Vaughan',
        children: [
            {
                name: 'Bushra Thomas',
                children: [{ name: 'Cyrus Henderson' }, { name: 'Dora Jordan' }, { name: 'Skyla Downs' }, { name: "Elissa O'Sullivan" }],
            },
        ],
        // ...
    },
    {
        name: 'Nathanael Villa',
        // ...
    },
];
The labelKey defines what will appear as the title for each sector.
 Sizing Copy Link  
By default, the segments corresponding to leaf nodes will have the same angle.
However, the Sunburst Series is best suited to providing size values to provide relative sizing between these sectors.
The sizeKey can be used to provide a numeric value to adjust the relative sizing. Additionally, the optional sizeName property can be set to set the title that appears next to the value in tooltips.
{
    series: [
        {
            type: 'sunburst',
            labelKey: 'name',
            sizeKey: 'gdp',
            sizeName: 'GDP',
        },
    ],
}
 Colour Scales Copy Link  
Sectors can also be coloured using a scale. This lets you add an extra dimension of information to your chart.
Colouring can be customised by the colorKey and colorRange values in the series options.
{
    series: [
        {
            type: 'sunburst',
            labelKey: 'name',
            sizeKey: 'gdp',
            sizeName: 'GDP',
            colorKey: 'gdpChange',
            colorName: 'Change',
            colorRange: ['#FF9800', '#8BC34A'],
        },
    ],
}
In this configuration:
colorKeysupplies numeric values for the colour scalecolorNamesets the title that appears next to the colour value in tooltipscolorRangesupplies the colours for the colour scale (optional)
 Other Colours Copy Link  
{
    series: [
        {
            type: 'sunburst',
            labelKey: 'name',
            sizeKey: 'gdp',
            sizeName: 'GDP',
            fills: ['#D32F2F', '#FF5722', '#283593'],
        },
    ],
}
In this configuration:
fillsandstrokesare an array of colours to use for the fills and strokes, where each node receives the colour indexed by the index of its root node
When a colorRange is used, the fills and strokes arrays are ignored
 Labels Copy Link  
All segments can contain both labels and secondary labels, which can be shrunk to fit in the available space.
{
    series: [
        {
            type: 'sunburst',
            labelKey: 'name',
            secondaryLabelKey: 'gdpChange',
            sizeKey: 'gdp',
            sizeName: 'GDP',
            label: {
                fontSize: 14,
                minimumFontSize: 9,
                spacing: 2,
            },
            secondaryLabel: {
                formatter: ({ value }) => (value != null ? percentageFormatter.format(value) : undefined),
            },
            padding: 3,
        },
    ],
}
In this configuration:
fontSizesets the size of the font.minimumFontSizewill enable the font size to shrink down to the given value if there is not enough space.spacingcontrols the amount of space below a label.paddingadds space between the edge of a sector and its contents.formatterallows customising the value of a label using a function.
 Gradient Legend Copy Link  
The Gradient Legend aids in matching the colour coding of the Sunburst Series to the underlying values, and is enabled by default.
series: [
    {
        type: 'sunburst',
        colorKey: 'gdpChange',
        // ...
    },
],
gradientLegend: {
    enabled: true,
}
 Position Copy Link  
By default the Gradient Legend is placed at the bottom of the chart. Use the position option to change this.
{
    gradientLegend: {
        position: 'right',
    },
}
When the position is left or right, the Gradient Legend displays the values in descending order. Use reverseOrder to change this.
 Size Copy Link  
{
    gradientLegend: {
        gradient: {
            thickness: 50,
            preferredLength: 400,
        },
    },
}
In the above configuration:
thicknesscontrols the thickness (or width) of the gradient bar.preferredLengthsets the initial length of the gradient bar. It is only preferred, as the Gradient Legend is constrained by the container edges.
 Labels Copy Link  
It is possible to customise the font, colour and padding of the labels by using the scale options.
{
    gradientLegend: {
        scale: {
            label: {
                fontSize: 20,
                fontStyle: 'italic',
                fontWeight: 'bold',
                fontFamily: 'serif',
                color: 'red',
            },
            padding: 20,
        },
    },
}