How to find the cursor x axis and y axis values
How to find the cursor x axis and y axis values
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
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:
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);
}