Find out Series index on Teechart MouseMove event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Anil Kumar
Newbie
Newbie
Posts: 18
Joined: Tue Sep 04, 2007 12:00 am

Find out Series index on Teechart MouseMove event

Post by Anil Kumar » Mon Feb 02, 2009 8:13 am

I have chart with Multiple series. Inside MouseMove eventHandler of TeeChart, How to find the series index on which mouse pointer is placed?

Regards,
Priya

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Mon Feb 02, 2009 9:57 am

Hi Anil Kumar!

We propose the following code for find your index series:

Code: Select all

        private void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
           
            for(int i=0; i<tChart1.Series.Count;++i)
            {
                int tmp = tChart1.Series[i].Clicked(e.X, e.Y);
                if (tmp != -1)
                {
                    tChart1.Header.Text = "Series: " + i.ToString() + " Point: " + tmp.ToString();
                }

            }
            
}


Best Regards
Sandra Pazos


Steema Support Central
http://support.steema.com

Anil Kumar
Newbie
Newbie
Posts: 18
Joined: Tue Sep 04, 2007 12:00 am

Post by Anil Kumar » Wed Feb 04, 2009 8:12 am

Thanks, Sandra.

Post Reply