'Index was outside the bounds of the array' error message

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dan Smith
Newbie
Newbie
Posts: 15
Joined: Fri Sep 23, 2005 4:00 am

'Index was outside the bounds of the array' error message

Post by Dan Smith » Tue Nov 01, 2005 10:38 pm

Hello,

I am charting environmental data from 56 different streams and rivers. For 53 of the streams the charts work perfectly. For 3 of the streams I am getting the following error and I can't figure out what is causing it. Any ideas?

Server Error in '/wlr/waterres/StreamsData' Application.
--------------------------------------------------------------------------------

Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
Steema.TeeChart.Styles.ValueList.get_Item(Int32 index) +21
Steema.TeeChart.Styles.CustomBox.Percentile(Double P, Double InvN) +111
Steema.TeeChart.Styles.CustomBox.ReconstructFromData() +227
Steema.TeeChart.Styles.CustomBox.DoBeforeDrawValues() +27
Steema.TeeChart.Styles.Series.DrawSeries() +825
Steema.TeeChart.Chart.InternalDraw(Graphics g) +1005
Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r) +94
Steema.TeeChart.Chart.Draw(Graphics g) +88
Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height, PixelFormat pixelformat) +109
Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height) +11
Steema.TeeChart.Export.ImageExportFormat.Save(Stream stream) +92
Steema.TeeChart.Web.WebChart.CreatePictureFile(HtmlTextWriter writer) +780
Steema.TeeChart.Web.WebChart.Render(HtmlTextWriter output) +10
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +44
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +262
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241
System.Web.UI.Page.ProcessRequestMain() +1897




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

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

Post by Narcís » Wed Nov 02, 2005 12:59 pm

Hi Dan,

Could you please send us an example we can run "as-is" to reproduce the problem here?

You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.

Thanks in advance.
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

Dan Smith
Newbie
Newbie
Posts: 15
Joined: Fri Sep 23, 2005 4:00 am

Post by Dan Smith » Wed Nov 02, 2005 3:03 pm

I am sending an email with the code attached in a zip file.

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

Post by Narcís » Wed Nov 02, 2005 3:52 pm

Hi Dan,

Thanks for the project but I can't run it because Data.aspx is missing. Can you please check this?
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

Dan Smith
Newbie
Newbie
Posts: 15
Joined: Fri Sep 23, 2005 4:00 am

Post by Dan Smith » Wed Nov 02, 2005 4:49 pm

Sorry about that. I sent the Data.aspx page.

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 Nov 03, 2005 11:58 am

Hi Dan,

I get an error similar to your but not the same:
There is no row at position 0.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: There is no row at position 0.

Source Error:


Line 788:
Line 789:
Line 790: ((Steema.TeeChart.Styles.Box)chart1.Series[SeriesCount]).Position = int.Parse(dt.Rows[0]["C_Month"].ToString());
Line 791: SeriesCount++;
Line 792:


Source File: c:\inetpub\wwwroot\streams\chart.aspx.cs Line: 790

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
System.Data.DataRowCollection.get_Item(Int32 index)
streams.StreamPage.LoadBacteriaChart() in c:\inetpub\wwwroot\streams\chart.aspx.cs:790
streams.StreamPage.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\streams\chart.aspx.cs:60
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
Could you please send me an example you can reproduce "as-is"?

Thanks in advance.
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

Dan Smith
Newbie
Newbie
Posts: 15
Joined: Fri Sep 23, 2005 4:00 am

Post by Dan Smith » Thu Nov 03, 2005 7:07 pm

I figured out the problem. Boxplots need a minimum of three values to render. I was passing only two values in certain circumstances.

wilcohsu
Newbie
Newbie
Posts: 40
Joined: Mon Dec 18, 2006 12:00 am

Post by wilcohsu » Tue Mar 27, 2007 12:07 am

Hi,

When I add one sample or two sample into boxplot,
then occur Index was outside the bounds of the array exception.
But I don't know this bug when will been revised?

below is sample code:
box1.Add(new double[] { 35});
or
box1.Add(new double[] { 35,38});


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 » Tue Mar 27, 2007 8:54 am

Hi wilcohsu,

Haven't you read latest Dan's post? Please also read this thread for full explanation on how Box-Plot works.

You'll also find examples on how to use Box-Plot series at All Features\Welcome !\Chart styles\Statistical\Box-Plot in the features demo.

Thanks in advance.
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