Problem with search YValues of many series in a XValue point

TeeChart for ActiveX, COM and ASP
Post Reply
Haianh
Newbie
Newbie
Posts: 11
Joined: Wed Sep 17, 2008 12:00 am

Problem with search YValues of many series in a XValue point

Post by Haianh » Thu Dec 04, 2008 2:39 pm

Dear Steema,

We have 8 series of a chart with much data that loaded from DB (over 500 000 points).
We would like to read YValues of those series at a chart point when user click on a point in chart.
Currently, we load data so that XValues is the same for the 8 series.
By mouse position we use Axis.Bottom.CalPosPoint function to count the Axis.Bottom.XValue of this point.
After that, we use binary search to get index of this XValue in Series(0).XValues.
When we got index of this point , we loop for 8 series and read Series(i).YValues(index).
But now, we faced problem that DB contains Null values, and it must not be added in corresponding Serie. It means that XValues of 8 Series are different now.
So if we want to read YValues, we must use the search 8 times.
Do you have any idea to optimize the situation?
Because we must move the ColorLine to the read point and show read YValues to our screen. Plus much data that we are working with now, we are afraid about performance of chart view when user operates many times with this action.

Please give us your advice in this case.
Thanks and best regards.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Dec 04, 2008 2:53 pm

Hi Haianh,

I recommend you to do something as in the interpolating example I posted at this thread.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply