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
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
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
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
Hi Matti,
I'm in the process of building a sample to test your question. While I'm working on that could you please provide me with the specific product version and service release that you are using?
Hi Marianne,
Version is when i follow http://devcenter.infragistics.com/Support/ReleasedVersions.Aspx#HowToFindVersion
11.2.20112.2046
Hi,
I’m just following up on this forum post.
Is there anything further that I can help you with regarding this question?
The developers have completed investigating the behavior that I described to you and they do not believe this is a bug. Everything seems to be working as expected.
Based on the way the controls are laid out, IsMouseDirectlyOver is only true when the mouse is literally over the control, and there are no other controls separating the mouse from the desired control. Using Snoop they were able to determine that other controls are in the way, hence the property being set to false.
What I have found is that you can use wire up the MouseLeftButtonUp for the xamPieChart Legend. The sender will be the ItemLegend and it has Children. You can interrogate each item in the Children collection to determine if the IsMouseOver property of that item is set to true and work from there.
I am going to submit a development issue for you based on one behavior that I found while investigating your question. There is also an IsMouseDirectlyOver property that does not seem to be set.
I will create a case for you and follow up with you thru the case concerning this behavior.