Pie chart ClickSeries method always gets a valueIndex of 0?
Posted: Thu Oct 24, 2013 3:43 pm
I have created a simple .Net 3.5 project with one form with only a TChart. The accompanying code for the form is:
This code, while giving me Mouse X and Mouse Y values which are correct always ends up with a zero from the Clicked method calls and the valueIndex passed in.
Is there another way to get this information? Is there some flag which turns the Pie Chart Clicked ability on?
I am using TeeChart for .Net 2011. Version for reference is 4.1.2012.1032
Code: Select all
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim tSeries As Steema.TeeChart.Styles.Series = TChart1.Series.Add(New Steema.TeeChart.Styles.Pie)
For ii As Integer = 1 To 10
tSeries.Add(ii, ii.ToString())
Next
End Sub
Private Sub TChart1_ClickSeries(sender As Object, s As Steema.TeeChart.Styles.Series, valueIndex As Integer, e As System.Windows.Forms.MouseEventArgs) Handles TChart1.ClickSeries
If e.Button <> Windows.Forms.MouseButtons.Left Then Return
Dim tChart As Steema.TeeChart.Chart = DirectCast(sender, Steema.TeeChart.Chart)
Debug.Print("Series: " & tChart.Series.IndexOf(s).ToString())
Debug.Print("Value Index: " & valueIndex)
Debug.Print("Series YValue: " & s.YValues(valueIndex))
Debug.Print("Series XValues: " & s.XValues(valueIndex))
Debug.Print("Mouse X : " & e.X)
Debug.Print("Mouse Y : " & e.Y)
Debug.Print("s Clicked : " & tChart.Series(0).Clicked(e.X, e.Y))
Debug.Print("Series(0) Clicked : " & tChart.Series(0).Clicked(e.X, e.Y))
Debug.Print("Chart(0) Clicked : " & tChart(0).Clicked(e.X, e.Y))
End Sub
End Class
Is there another way to get this information? Is there some flag which turns the Pie Chart Clicked ability on?
I am using TeeChart for .Net 2011. Version for reference is 4.1.2012.1032