У меня есть круговая диаграмма, и я хочу взорваться и сделать другие вещи, когда кусок пирога установлен. Итак, мой вопрос: как я могу получить индекс, выбранный в коде
Вот мой XAML
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis></chart:CategoryAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis></chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
<chart:PieSeries PieCoefficient="0.6" MouseLeftButtonDown="pieSeries_MouseLeftButtonDown" ExplodeRadius="20" EnableAnimation="True" x:Name="pieSeries" ShowTooltip="True" chart:ChartTooltip.EnableAnimation="True" ItemsSource="{Binding Expenditure}" XBindingPath="Expense" Label="" LabelPosition="Outside" YBindingPath="Amount" Palette="Custom">
<chart:PieSeries.ColorModel>
<chart:ChartColorModel>
<chart:ChartColorModel.CustomBrushes>
<SolidColorBrush Color="Green"/>
<SolidColorBrush Color="Black"/>
<SolidColorBrush Color="Red"/>
<SolidColorBrush Color="#FFD541"/>
<SolidColorBrush Color="Plum"/>
<SolidColorBrush Color="Purple"/>
</chart:ChartColorModel.CustomBrushes>
</chart:ChartColorModel>
</chart:PieSeries.ColorModel>
<chart:PieSeries.AdornmentsInfo>
<chart:ChartAdornmentInfo AdornmentsPosition="Bottom" HorizontalAlignment="Center" VerticalAlignment="Center"
ConnectorLineStyle="{StaticResource lineStyle}" ShowConnectorLine="True"
ConnectorHeight="30" ShowLabel="True" LabelTemplate="{StaticResource labelTemplate}"
SegmentLabelContent="YValue">
</chart:ChartAdornmentInfo>
</chart:PieSeries.AdornmentsInfo>
</chart:PieSeries>
</chart:SfChart>
In the c# code I want The MouseLeftButtonDown Event to trigger the slice of the pie to explode private void pieSeries_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { }