windowsforms-120625-controls-and-libraries-sunburst-control-getting-started-lesson-1-create-an-unbound-sunburst.md
This tutorial explains how to create an application with a sunburst, populate it with items and configure its tooltip settings.
Run the Microsoft® Visual Studio. Select the File | New | Project… menu item. The New Project dialog appears. In this dialog, select Windows Desktop | Windows Forms App (.NET Framework). Click OK to create a project.
Open the Toolbox window. Drag the SunburstControl component from the DX.25.2: Data & Analytics section to the Form.
Click the Sunburst control’s smart tag and select the Dock in Parent Container link in the menu.
Click the sunburst’s smart tag. Select the Set Data Adapter… item in the menu.
The Data Adapter Editor appears.
Choose the SunburstItemStorage item in the drop-down list to assign a SunburstItemStorage object to the SunburstControl.DataAdapter property.
Click the SunburstItemStorage.Items property’s ellipsis button to invoke the Sunburst Item Collection Editor. Click the Add SunburstItem button to add the first item to the top-level items’ collection.
Specify the SunburstItem.Label property to USA.
Click the SunburstItem.Children property’s ellipsis button to populate the item’s Children collection with items.
Add five items using the Add SunburstItem button and specify their SunburstItem.Label and SunburstItem.Value properties using the following table’s data.
| Label | Value |
|---|---|
| Nuclear | 187.9 |
| Oil | 937.6 |
| Natural Gas | 582 |
| Hydro Electric | 59.8 |
| Coal | 564.3 |
Click the Close button to hide the Children collection editor and return to the top-level items’ collection editor.
Add a new item and specify its Label property to China. Populate its Children collection with items. For this, add five items and specify their Label and Value properties using the following table’s data.
| Label | Value |
|---|---|
| Nuclear | 11.3 |
| Oil | 308.6 |
| Natural Gas | 74.2 |
| Hydro Electric | 74.2 |
| Coal | 956.9 |
Click Close to return to the top-level items’ collection editor.
Add a new item and specify its Label property to Germany. Populate its Children collection with items. To do this, add five items and specify their Label and Value properties using the following table’s data.
| Label | Value |
|---|---|
| Nuclear | 37.8 |
| Oil | 123.6 |
| Natural Gas | 77.3 |
| Hydro Electric | 6.1 |
| Coal | 85.7 |
Click Close to return to the top-level items’ collection editor.
Click Close to hide the Sunburst Item Collection Editor.
Click Close to accept the Data Adapter’s configuration and close the editor.
A tooltip is shown when an end user hovers over a sunburst item. Specify the SunburstControl.ToolTipTextPattern property to {L}: {V:F2} Mt to format tooltips text.
Set the SunburstControl.StartAngle property to 50 to specify the sunburst’s rotation.
Run the project to see the result.