Page 1 of 1

Problem with search YValues of many series in a XValue point

Posted: Thu Dec 04, 2008 2:39 pm
by 13050339
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.

Posted: Thu Dec 04, 2008 2:53 pm
by narcis
Hi Haianh,

I recommend you to do something as in the interpolating example I posted at this thread.