Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
Itemlegend: ChartMouseEventArgs.chart is Nothing
posted

Hello,

i made a XamPieChart and a corresponding itemlegend:

 

<ig:ItemLegend  x:Name="PieLegend" HorizontalAlignment="Right"
 VerticalAlignment="Top" Margin="5,30,5,30" />
<ig:XamPieChart  Legend="{Binding ElementName=PieLegend}" Name="pieChart"/>

In code-behind:
 pieChart.LabelMemberPath = "Item"
 pieChart.ValueMemberPath = "Value"
 pieChart.ItemsSource = myData
That works great. But what i want to do now is that the user can interact with the legend like he interacts with the piechart.
For example: I made a slice explode when the user clicks on it and reverse.
 Public Shared Sub pieChart_SliceClick(sender As System.Object, e As Infragistics.Controls.Charts.SliceClickEventArgs)
        e.IsExploded = Not e.IsExploded
 End Sub
Now i want the same action when the user clicks on the related Legenditem.
A good start should be using the LegendItemMouseDown-event
 Private Shared Sub LegendItemMouseDown(sender As Object, e As DataChartLegendMouseButtonEventArgs)
 
 End Sub
But when i debug and look into e.chart, it is Nothing. I expected my pieChart in there. Is it a bug or did i something wrong?

P.S. Sorry for that awful formatting

Sincerely,
 matti