This article assists in creating a Sunburst chart using C#. It has details to set the IDE, a list of steps, and a sample code to render a Sunburst chart in Excel using C#. Sample data is created in the given sample code but you may load an existing Excel file containing the hierarchical data for testing this feature.
Steps to Create a Sunburst Chart using C#
- Set the IDE to use Aspose.Cells for .NET to create a Sunburst chart
- Create a new Workbook and set the name of the first worksheet, such as Hierarchy, in this example
- Create a hierarchical sample data and save it in a string array
- Set headers for the data and fill the worksheet with the sample data
- Create a Sunburst chart in the sheet at a specified cell position
- Set data series, category hierarchy, title, and visual style for the chart
- Save the resultant workbook on the local disk with sample data and a Sunburst chart
These steps explain the process to develop a Sunburst chart creator using C#. Create or load a Workbook with hierarchical data, add a Sunburst chart in it with a specified size and position on the sheet, set data series, category hierarchy, title, and visual style. Finally, customize the look and feel of the chart and save the resultant Workbook on the disk.
Code to Create Sunburst Chart using C#
This code demonstrates the process of creating a Sunburst chart maker using C#. You may change the style of the chart while opening it in Excel to get the desired visualization. Data must be in a hierarchical format with numbers in numeric format instead of a string to get the proper output.
This article has taught us the process to create a Sunburst chart. To find and replace text in an Excel file, refer to the article Find and replace in Excel using C#.