ComponentOne FlexChart for UWP
Selection
Sunburst Chart > Selection

The Sunburst chart lets you select data points by clicking a Sunburst slice. You can set the SelectionMode property provided by the FlexChartBase class to either of the following values in the ChartSelectionMode enumeration:

To customize the selection, you can use the SelectedItemOffset and the SelectedIemPosition property provided by the C1FlexPie class. The SelectedItemOffset property enables you to specify the offset of the selected Sunburst slice from the center of the control. And the SelectedItemPosition property allows you to specify the position of the selected Sunburst slice. The SelectedItemPosition property accepts values from the Position enumeration. Setting this property to a value other than 'None' causes the pie to rotate when an item is selected.

In addition, the C1Sunburst class provides the ChildItemsPath property that allows you to specify the collection containing child items in a hierarchical data. And the FlexChartBase class provides the SelectionStyle property that can be used to access the properties provided by the ChartStyle class to style the Sunburst chart.

The following image displays Sunburst chart with a data point selected.

The following code snippet sets these properties:

<Chart:C1Sunburst x:Name="sunburst" 
                  SelectionMode="Point" 
                  SelectedItemOffset="0.1" 
                  SelectedItemPosition="Top" 
                  LegendPosition="None"
                  Header="Quartely Sales" 
                  Footer="Company XYZ" 
                  InnerRadius="0.1" 
                  Reversed="True" 
                  Palette="Dark" 
                  Offset="0.1" 
                  ItemsSource="{Binding HierarchicalData}" 
                  Binding="Value" 
                  BindingName="Year,Quarter,Month" 
                  ChildItemsPath="Items" 
                  ToolTipContent="{}{name}&#x000A;{y}" 
                  Margin="-376,0,0,0" 
                  LegendTitle="Year"  >
    <Chart:C1Sunburst.LegendTitleStyle>
        <Chart:ChartStyle FontFamily="Arial" 
                          FontSize="10" 
                          FontStretch="Normal" 
                          FontWeight="Bold"/>
    </Chart:C1Sunburst.LegendTitleStyle>
    <Chart:C1Sunburst.HeaderStyle>
        <Chart:ChartStyle FontFamily="Arial" 
                          FontSize="12" 
                          FontStretch="Normal" 
                          FontWeight="Bold"/>
    </Chart:C1Sunburst.HeaderStyle>
    <Chart:C1Sunburst.FooterStyle>
        <Chart:ChartStyle FontFamily="Arial" 
                          FontSize="10" 
                          FontStretch="Normal" 
                          FontWeight="Bold"/>
    </Chart:C1Sunburst.FooterStyle>
    <Chart:C1Sunburst.DataLabel>
        <Chart:PieDataLabel Position="Inside" 
                            Content="{}{name}" 
                            ConnectingLine="True" 
                            Border="True">
        </Chart:PieDataLabel>
    </Chart:C1Sunburst.DataLabel>
</Chart:C1Sunburst>
C#
Copy Code
// set the SelectionMode property
sunburst.SelectionMode = C1.Chart.ChartSelectionMode.Point;

// set the SelectedItemOffset property
sunburst.SelectedItemOffset = 0.1;

// set the SelectedItemPosition property
sunburst.SelectedItemPosition = C1.Chart.Position.Top;

VB
Copy Code
' set the SelectionMode poperty
sunburst.SelectionMode = C1.Chart.ChartSelectionMode.Point

' set the SelectedItemOffset property
sunburst.SelectedItemOffset = 0.1

' set the SelectedItemPosition property
sunburst.SelectedItemPosition = C1.Chart.Position.Top