Page 1 of 1

Error when adding a point to a line graph

Posted: Tue Mar 24, 2009 1:48 pm
by 9637396
Hi

I have uploaded a screenshot for you that shows an exception I get in VB net 2005.
I can't understand why it happens. I run through a loop where I add values to a line series. at value number 51 it suddenly gives me an exception.
I have also included my watch window in the screen shot so that you can see the values I'm trying to insert.

Can you tell me what I'm doing wrong?

Thanks in advance
Lars Iversen

Posted: Tue Mar 24, 2009 2:24 pm
by narcis
Hi Lars,

It would be very helpful if you sent us a simple example project we can run "as-is" to reproduce the problem here.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Tue Mar 24, 2009 2:28 pm
by 9637396
Hi NarcĂ­s

I think it will be hard for me to create a stand-alone example.
This is part of a big application which uses a ms SQL server database. So it would take me quite a wile to create a stand alone example.

I just hoped that you had seen the error before and could give a quick solution.

I'll try to investigate it further and if I don't get a break-through I'll see if I can make a stand alone version for you.

BR Lars

Posted: Tue Mar 24, 2009 2:37 pm
by narcis
Hi Lars,

I'm sorry but it's very difficult guessing which the problem can be without being able to reproduce it. Have you checked that your indices don't exceed any array capacity?

Posted: Tue Mar 24, 2009 2:55 pm
by 9637396
I have come a bit further:

This line executes ok
tChart.Series(intSeriesID).Add(421,-1000.1,"hewj")

This line gives the error: Index must be within the bounds of the List.
tChart.Series(intSeriesID).Add(422,-1000.1,"hewj")

I can not reproduce this in a stand alone app.

Is there some kind of setting that could be set on my X-axis that makes it impossible to add the xValue of 422 ?
(reason why I'm asking is that the application that I'm working on is very big and a lot of settings are set before I reach my error. So I'm having trouble finding exactly what setting creates the problem)

Thanks

Lars Iversen

Posted: Tue Mar 24, 2009 3:03 pm
by 9637396
.. and by the way this line works fine:

tChart.Series(intSeriesID).Add(422,-1000.1)

and from my previous post, this does not work:

tChart.Series(intSeriesID).Add(422,-1000.1,"hewj")

So it must be the combination og x value and caption that creates the problem. Still can't reproduce in a stand alone project :o(

Arghh ! :o)