How to find the cursor x axis and y axis values

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
samir
Newbie
Newbie
Posts: 12
Joined: Fri Feb 04, 2005 5:00 am

How to find the cursor x axis and y axis values

Post by samir » Sat Feb 10, 2007 6:48 am

I am anable to find the values of the x axis and y axis on cursor (cross hair move) I need it to display the exact position of the point in terms of the axis value

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Mon Feb 12, 2007 9:07 am

Hi Samir

You can use the MouseMove event to know the position of the cursor (e.X and e.Y). Those positions are screen pixels, you have to convert them using axes' CalcPosPoint method as below code:

Code: Select all

 private void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
            tChart1.Text = "Pos x: " + tChart1.Axes.Bottom.CalcPosPoint(e.X) + "\nPos y: " + tChart1.Axes.Left.CalcPosPoint(e.Y);            
        }
Best Regards,
Edu

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

Post Reply