Select Points in teeChart?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
leaf
Newbie
Newbie
Posts: 2
Joined: Fri Nov 15, 2002 12:00 am

Select Points in teeChart?

Post by leaf » Tue Feb 22, 2005 7:45 pm

Hi,

I have several series in teeChart. I'd like the user to draw a rect bound to select all the points fall into that bound. Is there any easy way I can do that?

Thanks.

Stanley

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed Feb 23, 2005 6:56 am

Hi, Stanley.

Let's say you already defined the bounding rectangle: either by using chart OnMouseDown, onMouseMove and OnMouseUp events or by other methods. Now you have to cycle through all series points and if specific point is in defined bounding rectangle (you can use PtInRect method to test this), add series index and point index to the list of highligted points. Finally, you can use this information to change the color of selected points or alternatively, use series OnGetPointerStyle event to change the style of specific series points.
Marjan Slatinek,
http://www.steema.com

leaf
Newbie
Newbie
Posts: 2
Joined: Fri Nov 15, 2002 12:00 am

It works

Post by leaf » Wed Feb 23, 2005 9:27 pm

Thanks for the tips. It works.
:) :)

leaf
Newbie
Newbie
Posts: 37
Joined: Fri Nov 15, 2002 12:00 am

Coordiates Conversion

Post by leaf » Thu Feb 24, 2005 7:29 pm

It's almost working.

I have the rect from moue down/up. I have the points in series. But I cann't convert the x, y to screen coordiates.

Please advise.

Thanks.

beetle
Newbie
Newbie
Posts: 59
Joined: Fri Dec 12, 2003 5:00 am

Post by beetle » Thu Feb 24, 2005 7:36 pm

Hi, try using 'CalcXPosValue' and 'CalcYPosValue' methods of TChartSeries

leaf
Newbie
Newbie
Posts: 37
Joined: Fri Nov 15, 2002 12:00 am

Yes, got it

Post by leaf » Thu Feb 24, 2005 7:57 pm

Yes, I found the same function. Life is good again.
:D

Post Reply