Spread WPF 18
Features / Charts / Chart Types / Specialized Charts / Sunburst Chart
In This Topic
    Sunburst Chart
    In This Topic

    Sunburst charts are used to display hierarchical data depicted by concentric circles. You can use this type of chart when data is organized hierarchically and has many categories.

    Sample Image Description

    ChartType.Sunburst

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


     

    Using Code

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

    Copy Code
    // Sunburst chart
    object[,] dataArray = {
                 { "Region", "Subregion", "Country", "Population"},
     { "Asia", "Southern", "India", 9541854},
     {"","" , "Pakistan", 2003818},
     {"",""  , "Thailand", 4668149},
     {"","" , "Others", 1700300},
     {"", "Eastern", "China", 15045928},
     {"","" , "Japan", 5271852},
     {"","" , "Others", 1912273},
     {"", "South-Eastern","" , 9536576},
     {"", "Western", "", 2722989},
     {"", "Central","" , 7186065},
     { "Africa", "Eastern","" , 3043132},
     {"", "Western","" , 3819688},
     {"", "Northern","" , 2784677},
     {"", "Others","" , 2512021},
     { "Europe","" ,"" , 7448010},
     { "Others","" ,"" , 10117703}
             };
    
    for (int i = 0; i < dataArray.GetLength(0); i++)
    {
         for (int j = 0; j < dataArray.GetLength(1); j++)
         {
             spreadSheet1.Workbook.ActiveSheet.Cells[i, j].Value = dataArray[i, j];
         }
    }
    spreadSheet1.Workbook.ActiveSheet.Cells["A1:D17"].Select();
    spreadSheet1.Workbook.ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Sunburst, 100, 150, 400, 300, true);
    spreadSheet1.Workbook.ActiveSheet.ChartObjects[0].Chart.ChartTitle.Text = "Sunburst chart";
    
    Copy Code
    ' Sunburst chart.
    Dim dataArray = {
                     {"Region", "Subregion", "Country", "Population"},
         {"Asia", "Southern", "India", 9541854},
         {"", "", "Pakistan", 2003818},
         {"", "", "Thailand", 4668149},
         {"", "", "Others", 1700300},
         {"", "Eastern", "China", 15045928},
         {"", "", "Japan", 5271852},
         {"", "", "Others", 1912273},
         {"", "South-Eastern", "", 9536576},
         {"", "Western", "", 2722989},
         {"", "Central", "", 7186065},
         {"Africa", "Eastern", "", 3043132},
         {"", "Western", "", 3819688},
         {"", "Northern", "", 2784677},
         {"", "Others", "", 2512021},
         {"Europe", "", "", 7448010},
                  {"Others", "", "", 10117703}}
    
    For i = 0 To dataArray.GetLength(0) - 1
            For j = 0 To dataArray.GetLength(1) - 1
                spreadSheet1.Workbook.ActiveSheet.Cells(i, j).Value = dataArray(i, j)
            Next
    Next
    spreadSheet1.Workbook.ActiveSheet.Cells("A1:D17").[Select]()
    spreadSheet1.Workbook.ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Sunburst, 100, 150, 400, 300, True)
    spreadSheet1.Workbook.ActiveSheet.ChartObjects(0).Chart.ChartTitle.Text = "Sunburst chart"