Page 1 of 1

Getting grid coordinates after a mouse click

Posted: Fri Jun 02, 2006 6:17 pm
by 8129268
Hi, I need to get the actual x-y values after the user has clicked somewhere on the graph. Any help would be appreciated, thanks.

JRB

Posted: Tue Jun 06, 2006 8:56 am
by narcis
Hi JRB,

You can do this:

Code: Select all

    private void tChart1_MouseDown(object sender, MouseEventArgs e)
    {
      label1.Text = tChart1.Axes.Bottom.CalcPosPoint(e.X).ToString();
      label2.Text = tChart1.Axes.Left.CalcPosPoint(e.Y).ToString();      
    }
If it is not what are you exactly trying to get don't hesitate to ask it here.