[]
        
(Showing Draft Content)

Sunburst Chart

Sunburst charts are used to display hierarchical data as concentric rings. Each ring in the chart represents a level in the hierarchy where the innermost ring is at the top of the hierarchy. The segments in each ring divide the data into sub-categories. The sizes of the segments indicate the proportion of data as per their parent category.

You can use this type of chart when data is organized hierarchically and has multiple categories.

Sample Image

Description

image

 

ChartType.Sunburst

Represents a sunburst chart. It is used to compare values across hierarchy levels.

Refer to the following example code to add a sunburst chart.

C#

// Enable enhanced shape and chart engines.
fpSpread1.Features.EnhancedShapeEngine = true;
fpSpread1.Features.EnhancedChartEngine = true;
// Sunburst chart
object[,] dataArraySubBurst = {
    {"Region", "Subregion", "Country", "Population"},
    {"Asia", "South", "India", 9540554},
    {"","" , "Pakistan", 2003818},
    {"","" , "Thailand", 4668149},
    {"","" , "Others", 1702200},
    {"", "East", "China", 12155928},
    {"","" , "Japan", 5271332},
    {"","" , "Others", 1916573},
    {"", "South-East","" , 9556576},
    {"", "West","" , 2728399},
    {"", "Central", "", 7186065},
    {"Africa", "East","" , 4333132},
    {"", "West","" , 3880688},
    {"", "North","" , 2374677},
    {"", "Others","" , 2312021},
    {"Europe","" ,"" , 7448010},
    {"Others","" ,"" , 10117703}
};
for (int i = 0; i < dataArraySubBurst.GetLength(0); i++)
{
    for (int j = 0; j < dataArraySubBurst.GetLength(1); j++)
    {
        fpSpread1.AsWorkbook().ActiveSheet.Cells[i, j].Value = dataArraySubBurst[i, j];
    }
}
fpSpread1.AsWorkbook().ActiveSheet.Cells["A1:D17"].Select();
fpSpread1.AsWorkbook().ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Sunburst, 200, 350, 500, 400, false);
fpSpread1.AsWorkbook().ActiveSheet.ChartObjects[0].Chart.ChartTitle.Text = "World Population";
fpSpread1.AsWorkbook().ActiveSheet.ChartObjects[0].Chart.ApplyDataLabels(DataLabelVisibilities.CategoryName);

VB

' Enable enhanced shape and chart engines.
fpSpread1.Features.EnhancedShapeEngine = True
fpSpread1.Features.EnhancedChartEngine = True
' Sunburst chart
Dim dataArraySubBurst As Object(,) = {
    {"Region", "Subregion", "Country", "Population"},
    {"Asia", "South", "India", 9540554},
    {"", "", "Pakistan", 2003818},
    {"", "", "Thailand", 4668149},
    {"", "", "Others", 1702200},
    {"", "East", "China", 12155928},
    {"", "", "Japan", 5271332},
    {"", "", "Others", 1916573},
    {"", "South-East", "", 9556576},
    {"", "West", "", 2728399},
    {"", "Central", "", 7186065},
    {"Africa", "East", "", 4333132},
    {"", "West", "", 3880688},
    {"", "North", "", 2374677},
    {"", "Others", "", 2312021},
    {"Europe", "", "", 7448010},
    {"Others", "", "", 10117703}
}
For i As Integer = 0 To dataArraySubBurst.GetLength(0) - 1
    For j As Integer = 0 To dataArraySubBurst.GetLength(1) - 1
        fpSpread1.AsWorkbook().ActiveSheet.Cells(i, j).Value = dataArraySubBurst(i, j)
    Next
Next
fpSpread1.AsWorkbook().ActiveSheet.Cells("A1:D17").Select()
fpSpread1.AsWorkbook().ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Sunburst, 200, 350, 500, 400, False)
fpSpread1.AsWorkbook().ActiveSheet.ChartObjects(0).Chart.ChartTitle.Text = "World Population"
fpSpread1.AsWorkbook().ActiveSheet.ChartObjects(0).Chart.ApplyDataLabels(DataLabelVisibilities.CategoryName)