Page 1 of 1

Pie chart ClickSeries method always gets a valueIndex of 0?

Posted: Thu Oct 24, 2013 3:43 pm
by 15048900
I have created a simple .Net 3.5 project with one form with only a TChart. The accompanying code for the form is:

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
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

Re: Pie chart ClickSeries method always gets a valueIndex of 0?

Posted: Thu Oct 24, 2013 7:46 pm
by 15048900
I see in the latest version it might be fixed. Not sure we can upgrade but I see:
Bugfixes/changes:
...
3) [TF02016154]
Pie's Clicked function returned 0 when the mouse
was over the series instead of returning the
slice ValueIndex. Fixed.
...
Is there a way around it with the version I have?

Re: Pie chart ClickSeries method always gets a valueIndex of 0?

Posted: Fri Oct 25, 2013 11:09 am
by 10050769
Hello biqpaulson,

Your code using latest versions of TeeChartFor.Net is fixed, as you see in the release notes. The bug (TF02016154) is fixed since build number 4.1.2012.07133. I am sorry, but I can not suggest an a workaround for your problem. In this point, I suggest you check the evaluation installer to verify your problem is solved in latest version. You can download it here.

If you have some more problems please let me know.

Thanks,