Lesson 1 - Create an Unbound Sunburst

  • 3 minutes to read

This tutorial explains how to create an application with a sunburst, populate it with items and configure its tooltip settings.

Step 1. Create a New Project

Run the Microsoft® Visual Studio® 2012, 2013, 2015 or 2017. 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.

new-winforms-application

Step 2. Add the Sunburst Control to the Form

Open the Toolbox window. Drag the SunburstControl component from the DX.20.1: Data & Analytics section to the Form.

drag-sunburst-from-toolbox

Step 3. Dock the SunburstControl in the Form

Click the Sunburst control's smart tag and select the Dock in Parent Container link in the menu.

dock-in-parent-container

Step 4. Add Items to the Sunburst

Click the sunburst's smart tag. Select the Set Data Adapter... item in the menu.

smart-tag-menu_set-data-adapter

The Data Adapter Editor appears.

Choose the SunburstItemStorage item in the drop-down list to assign a SunburstItemStorage object to the SunburstControl.DataAdapter property.

data-adapter-editor_sunburst-item-storage

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.

edit-items-collection_add-new-item

Specify the SunburstItem.Label property to USA.

sunburst-item-usa-item-label

Click the SunburstItem.Children property's ellipsis button to populate the item's Children collection with items.

sunburst-item-usa-item-children

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.

sunburst-item--edit-children-collection

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.

edit-china-item-children-collection

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.

edit-germany-item-chidren-collection

Click Close to hide the Sunburst Item Collection Editor.

close-top-level-items-collection-editor

Click Close to accept the Data Adapter's configuration and close the editor.

close-data-adapter-editor

Step 5. Configure Item Tooltip Options

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.

specify-tooltip-pattern

Step 6. Rotate the Sunburst

Set the SunburstControl.StartAngle property to 50 to specify the sunburst's rotation.

specify-start-angle

Result

Run the project to see the result.

sunburst-lesson1-result