We get a System.IndexOutOfRangeException when we want to show a hidden highLow serie. The Teechart is used in a ASP.net 2003 application.
The chart is created with the highLow series hidden. Then we cache the chart so we have it after a postback.
In the event of a checkbox we switch the serie on or off. (value checkbox).
When we do this in code by generate the chart there is no problem (we can hide and show, but when we do this in like so :
Code: Select all
// something goes here wrong !!! indexout of bound exeption
private void minMaxValue_CheckedChanged(object sender, System.EventArgs e)
{
try
{
bool minMaxChecked = minMaxValue.Checked;
foreach(DictionaryEntry lineDescEntry in WebChartSerieLineDesc)
{
string lineDesc = lineDescEntry.Value.ToString().ToLower();
int serieNr = int.Parse(lineDescEntry.Key.ToString());
if ((lineDesc == "min") || (lineDesc== "max"))
{
if(GraphDetail.Chart.Series[serieNr].Visible != minMaxChecked)
{
GraphDetail.Chart.Series[serieNr].Visible = minMaxChecked;
}
}
else
{
if(lineDesc == "min/max")
{
// HighLow series
Steema.TeeChart.Styles.HighLow highLowStyle = (Steema.TeeChart.Styles.HighLow)GraphDetail.Chart.Series[serieNr];
highLowStyle.Visible = minMaxChecked;
}
}
}
}
catch (Exception error)
{
HDBPageHeaderSubPlus.ErrorMessage = error.Message;
General.Log.Write(error,"minMaxValue_CheckedChanged",pageName);
}
}
}
Global.asax.Application_Error: Error: System.Web.HttpUnhandledException: Er is een uitzondering van het type System.Web.HttpUnhandledException veroorzaakt. ---> System.IndexOutOfRangeException: De index ligt buiten de matrixgrenzen.
at Steema.TeeChart.Styles.ValueList.get_Item(Int32 index)
at Steema.TeeChart.Styles.HighLow.DrawValue(Int32 valueIndex)
at Steema.TeeChart.Styles.Series.Draw()
at Steema.TeeChart.Styles.Series.DrawSeries()
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r)
at Steema.TeeChart.Chart.Draw(Graphics g)
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height, PixelFormat pixelformat)
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height)
at Steema.TeeChart.Export.ImageExportFormat.Save(Stream stream)
at Steema.TeeChart.Web.WebChart.CreatePictureFile(HtmlTextWriter writer)
at Steema.TeeChart.Web.WebChart.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain()
--- Einde van intern uitzonderingsstackpad ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
We tried several things but without succes is this a bug in the TeeChart object !!!
Version TeeChart :
Release Notes June 2005
TeeChart.NET Version 1
Build 1.1.2004.16592
Thanks,
Roland Hillebrand