I am using VB 2008 with the Microsoft Chart Controls for .NET Framework. Using a pie chart, I would like to find the selected item when the chart is clicked or double clicked.
I am have the click and doubleclick events as shown here, which I have confirmed is being hit, and the the eventarts contains the x,y position of the click.
Private Sub Chart_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs)
Private Sub Chart_Click(ByVal sender As Object, ByVal e As System.EventArgs)
What I would really like to find out is what series item was clicked or doubleclicked (what pie slice).
This is being done in a windows forms application.
How do I get the series item clicked or doubleclicked?
The following gives you the chart element under the Mouse.
Note that you should probably do some checking to make sure it is a Series that the user clicks on by checking the HTR.ChartElementType. Oh, and this should go in a MouseUp event, since the e that I use are MouseEventArgs.