how can i capture points in a selected region of the chart?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
queija
Newbie
Newbie
Posts: 2
Joined: Fri Mar 13, 2009 12:00 am

how can i capture points in a selected region of the chart?

Post by queija » Wed Mar 25, 2009 6:26 pm

I have plot one serie in a chart and want to get all the points under one region defined by a rectangle.

Can you help me?

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

Post by Yeray » Thu Mar 26, 2009 9:12 am

Hi queija,

Please, take a look at the code that Narcís posted here. It's a NET example but you shouldn't find many problems translating it.

In a few words, having the Rect and the series, you should look around the series points and see if they are in the rect or not. Basically, the most important functions you should use are, first, to retrieve each point position in pixels:

Code: Select all

Series1.CalcXPos(Index)
Series1.CalcYPos(Index)
And having each point and the rect, you could use a delphi function (this is not present in NET)

Code: Select all

function PtInRect(const Rect: TRect; const P: TPoint): Boolean;
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

Post Reply