Xuni User Guide > Xuni Controls > FlexPie > Features > Selection |
You can change the position of the selected pie slice by setting the SelectedItemPosition
property. There are four options available in this property:
The SelectedItemOffset
property allows you to move the selected pie slice away from the center of the FlexPie. You can also set the SelectedBorderColor
and SelectedBorderWidth
properties of the FlexPie control to highlight the selected slice.
The image below shows how the FlexPie appears after these properties have been set.
The following code examples demonstrate how to set these properties in C# and in XAML. These examples use the sample created in the Quick Start section.
C# |
Copy Code |
---|---|
chart.SelectedItemPosition = Xuni.Xamarin.ChartCore.ChartPositionType.Top; chart.SelectedItemOffset = 0.1; chart.SelectedBorderColor = Color.Blue; chart.SelectedBorderWidth = 5; |
XAML |
Copy Code |
---|---|
<xuni:FlexPie x:Name="chart" ItemsSource="{Binding Data}" BindingName="Name" Binding ="Value" SelectedItemOffset = "0.1" SelectedBorderColor = "Blue" SelectedBorderWidth = "5" SelectedItemPosition = "Top" Grid.Row="1" Grid.ColumnSpan="2"> </xuni:FlexPie> |