clicked in chart area?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

clicked in chart area?

Post by noaksey » Wed Feb 04, 2009 2:16 pm

Hey,

Is there an easy way (boolean, or what have you..) to check if the user clicks in the actual chart area (so the area inside all 4 axes), rather than just the chart control?

Regards,
Chris.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Feb 04, 2009 2:40 pm

Hi Chris,

The easiest way I can think is verifying in OnMouseDown event if the mouse coordinates are in the ChartRect or not. Something like this:

Code: Select all

void tChart1_MouseDown(object sender, MouseEventArgs e)
        {
            Rectangle rect = tChart1.Chart.ChartRect;
            Text = rect.Contains(new Point(e.X, e.Y)) ? "Mouse in ChartRect!" : "";
        }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Post by noaksey » Wed Feb 04, 2009 4:40 pm

that's exactly what I wanted, cheers Yeray

Post Reply