Xuni User Guide > Xuni Controls > FlexChart > Features > Selection |
You can choose what element of the FlexChart should be selected when the user taps on any region in a FlexChart by setting the SelectionMode
property. This property provides three options:
You can also set the SelectedBorderColor
and SelectedBorderWidth
properties of the FlexChart control to customize the selected item.
The images below show how the FlexChart appears after these properties have been set.
When SelectionMode is set to Series
When SelectionMode is set to Point
The following code examples demonstrate how to set these properties in C# and in XAML. These examples use the samples created in the Quick Start section.
C# |
Copy Code |
---|---|
chart.SelectionMode = Xuni.Xamarin.ChartCore.ChartSelectionModeType.Point; chart.SelectedBorderColor = Color.FromHex("#FFFFFF"); chart.SelectedBorderWidth = 5; chart.SelectedDashes = new double[] { 2, 1 }; |
XAML |
Copy Code |
---|---|
<xuni:FlexChart x:Name="chart" ChartType="Column" ItemsSource="{Binding Data}" BindingX="Name" SelectionMode="Point" SelectedBorderColor="#FFFFFF" SelectedBorderWidth = "5" SelectedDashes="2,1" Grid.Row="1" Grid.ColumnSpan="2"> <xuni:FlexChart.Series> <xuni:ChartSeries x:Name="Sales2014" Name="2014 Sales" Binding="Sales" ></xuni:ChartSeries> </xuni:FlexChart.Series> </xuni:FlexChart> |