Page 1 of 1
Problem with ClickAxis event and 3D chart
Posted: Mon Jul 10, 2006 9:39 am
by 9641771
I need to draw a point on Axis in place of mouse click (3D Chart and two surface series). But ClickAxis appears when I'm clicking somewhere outside axes (looks like this event appears while clicking imaginary 2D axes to the left of zero point of my 3D axes). Moreover this imaginary axes stay at the same place while I'm rotating and elevating my real 3D axes. How could I use this event properly for my 3D axes?
Posted: Tue Jul 11, 2006 11:46 am
by narcis
Hi bairog,
Please see my reply at your
other message.
Posted: Thu Jul 13, 2006 8:23 am
by 9641771
I can't understand exactly what do you mean. Do you recommend me to use MouseClick event instead of ClixkAxis? I can calculate XYZ position of a click using Mouseclick event arguments as you told me. But how can I determine XYZ posiyion of Axes depending of zoom, rotation and elevation of chart? I need these coordinates to determine if the axis was clicked but not something else. Help me with example please.
Thank you.
Posted: Thu Jul 13, 2006 3:04 pm
by narcis
Hi bairog,
Ok, you can do something like the code below but it neither works for OpenGL charts nor for non-orthogonal charts (default elevation or rotation changed). So I've added this issue (TF02011581) to our defect list to be fixed for future releases.
Code: Select all
private void tChart1_MouseClick(object sender, MouseEventArgs e)
{
for (int i = 0; i < tChart1.Axes.Count; i++)
{
if (tChart1.Axes[i].Clicked(e.X, e.Y))
{
switch (i)
{
case 0: tChart1.Header.Text = "Left"; break;
case 1: tChart1.Header.Text = "Top"; break;
case 2: tChart1.Header.Text = "Right"; break;
case 3: tChart1.Header.Text = "Bottom"; break;
}
}
}
}
Posted: Thu Jul 20, 2006 8:51 am
by 9641771
There is suspicion that Clicked property workes correctly only for X and Y axes. I used orthogonal 3D chart and the following code
Code: Select all
private void tChart1_MouseMove(object sender, MouseEventArgs e)
{
label1.Text = e.X.ToString();
label2.Text = e.Y.ToString();
if (tChart1.Axes.Left.Clicked(e.X, e.Y) != false)
{
label3.Text = "Left";
}
else
if (tChart1.Axes.Bottom.Clicked(e.X, e.Y) != false)
label3.Text = "Bottom";
else
if (tChart1.Axes.Depth.Clicked(e.X, e.Y) != false)
label3.Text = "Depth";
else
label3.Text = "None";
}
and didn't find position where I could see "Depth" text (when my cursor was ower depth axis "None" text appeared).
Posted: Thu Jul 20, 2006 10:43 am
by narcis
Hi bairog,
This is the same problem I told you replying to
your other thread.