Page 1 of 1

index out of range error

Posted: Wed Feb 09, 2005 10:01 am
by 8123657
Hello,
I am using the chart to present info from a collection,if I load a collection and it is being presented on a chart (line series) and I am pressing a point on a line than I am loading this line but with other data where the number of points is less than the previous and than I am getting an error because the chart excpects to get the point it was pressed before.
For example: I am pressing (9,20) and than loading data with only 3 points -> I get an error.
Could you please explaine me how can I init the chart each time,not to expect those points??

(I tried with the tChart1.Series[0].Clear(); but it didn't affect it)
Thanks a lot!

Posted: Wed Feb 09, 2005 10:41 am
by narcis
Hi .net,

I don't understand very much what are you trying to do, but the code below may do what are you looking for.

Code: Select all

tChart1.Series[0].Delete(0,tChart1.Series[0].Count-1);
After having deleted all original series points then you can repopulate again.

Posted: Wed Feb 09, 2005 11:55 am
by 8123657
Hello,
it's not helping.
I still gret an error - it happens when I load a data to a line then click on the line in some point (for example 10,20) and than load a new line on this chart which doesn't have points in those coordinates(it shorter).
How can I solve this?
Maybe I can scroll it some way to the beggining of the chart?
Thank you!

Posted: Tue Mar 01, 2005 3:42 pm
by Pep
Hi,

could you please post the code you're using to reproduce the problem here ? of post a simple example into the news://www.steema.net/steema.public.attachments newsgroup ?