Page 1 of 1

Select Points in teeChart?

Posted: Tue Feb 22, 2005 7:45 pm
by 5894662
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

Posted: Wed Feb 23, 2005 6:56 am
by Marjan
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.

It works

Posted: Wed Feb 23, 2005 9:27 pm
by 5894662
Thanks for the tips. It works.
:) :)

Coordiates Conversion

Posted: Thu Feb 24, 2005 7:29 pm
by 8572663
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.

Posted: Thu Feb 24, 2005 7:36 pm
by 9335230
Hi, try using 'CalcXPosValue' and 'CalcYPosValue' methods of TChartSeries

Yes, got it

Posted: Thu Feb 24, 2005 7:57 pm
by 8572663
Yes, I found the same function. Life is good again.
:D