[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Collapse]Sunburst Control
   [Collapse]Getting Started
     Lesson 1 - Create an Unbound Sunburst
     Lesson 2 - Create a Sunburst and Bind it to Data
    Provide Data
    Highlight and Select Items
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Lesson 2 - Create a Sunburst and Bind it to Data

This tutorial explains how to create an application with a sunburst, bind it to data, and configure the sunburst's center label and colorizer settings.

Expanded Step 1. Create an Application and Add the Sunburst to the Form

Run the Microsoft® Visual Studio® 2015 or 2017. Create a Windows Forms project and add the SunburstControl to the Form (see the Steps 1-3 in Lesson 1).

Expanded Step 2. Describe Data Objects

Right-click the project in the Solution Explorer window and select the Add | Class... item.

The Add New Item dialog appears.

Specify the class name as ProductInfo.cs in the Add New Item dialog and click Add.

Replace the auto-generated ProductInfo class declaration with the following code.

Expanded Step 3. Configure a Data Source

Create the method that returns the data objects list that will be used as the sunburst's data source. Add the method's code to the Form class.

Expanded Step 4. Specify the Sunburst's Data Adapter

Assign the SunburstFlatDataAdapter to the SunburstControl.DataAdapter property.

Set the SunburstFlatDataAdapter.ValueDataMember property to Income.

Set the SunburstFlatDataAdapter.LabelDataMember property to Product.

Click the SunburstFlatDataAdapter.GroupDataMembers property's ellipsis button. In the invoked editor, add the following lines to group products by countries and categories.



In this step, use the CreateProductInfos method (Step 3) to specify SunburstFlatDataAdapter.DataSource. Handle the Form.Load event and change the event handler's code as follows.

Expanded Step 5. Change the Center Label Text

Specify the SunburstCenterLabel.TextPattern property to Total: {TV} to modify the Center Label's text. The {TV} placeholder allows you to display the sum of top-level item values.

Expanded Step 6. Configure Colorizer Settings

Colorizers automatically provide sunburst items with colors. You use the Gradient Colorizer in this step. Assign SunburstGradientColorizer to the SunburstControl.Colorizer property.

Define how color transparency should change from top-level items to their child items. Set the SunburstGradientColorizer.Max property to 0.9 and SunburstGradientColorizer.Min to 0.4.

Select the Pastel Kit palette in the SunburstPaletteColorizerBase.Palette property's drop-down list.

Expanded Result

Run the project to see the result.

Is this topic helpful?​​​​​​​