Unexpected Exception is happened when draw a points series.
Posted: Mon Feb 22, 2010 4:11 am
To whom it may concern:
I am writing in connection with an unexpected exception when the teechart draw a points series.
The exception is like this:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
At: Steema.TeeChart.Styles.ValueList.get_Last()
At: Steema.TeeChart.Styles.Series.CalcFirstLastVisibleIndex()
At: Steema.TeeChart.Styles.CustomPoint.CalcFirstLastVisibleIndex()
At: Steema.TeeChart.Styles.Series.DrawSeries()
At: Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
At: Steema.TeeChart.Chart.InternalDraw(Graphics g)
At: Steema.TeeChart.TChart.Draw(Graphics g)
At: Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
At: System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
At: System.Windows.Forms.Control.WmPaint(Message& m)
At: System.Windows.Forms.Control.WndProc(Message& m)
At: System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
At: System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
At: System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The my chart application has the Exception Catch Code at TeeChart Draw Code.
However that Catch Code can not catch this unexpected exception but other Catch Code in Main catch this thing.
I think that my codes don't have bugs about this exception. So, maybe This exception is happened by TeeChart's code.
Let me know whether you would like me to help this problem. I am looking forward to a solution.
Thank you.
ref:
The points series of my TeeChart has 38000 values. (I think there are so many values in one series.)
My code is like this:
addPointsValue(_pointSeries, dblCoordinateX, dblCoordinateY,
AppData.getColor(imaxValue, iminValue, dblValue), dblValue.ToString());
//AppData.getColor(double maxValue, double minValue, double value) is a function what gets a color by concerning the value's proportion between max and min)
private void addPointsValue(Points iobjPoints, double x, double y, Color ivalueColor, string istrLabel)
{
try
{
iobjPoints.Add(x, y, istrLabel, ivalueColor);
}
catch (Exception ex)
{
throw ex;
}
}
private Points _representiveSeries = null;
I am writing in connection with an unexpected exception when the teechart draw a points series.
The exception is like this:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
At: Steema.TeeChart.Styles.ValueList.get_Last()
At: Steema.TeeChart.Styles.Series.CalcFirstLastVisibleIndex()
At: Steema.TeeChart.Styles.CustomPoint.CalcFirstLastVisibleIndex()
At: Steema.TeeChart.Styles.Series.DrawSeries()
At: Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
At: Steema.TeeChart.Chart.InternalDraw(Graphics g)
At: Steema.TeeChart.TChart.Draw(Graphics g)
At: Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
At: System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
At: System.Windows.Forms.Control.WmPaint(Message& m)
At: System.Windows.Forms.Control.WndProc(Message& m)
At: System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
At: System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
At: System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The my chart application has the Exception Catch Code at TeeChart Draw Code.
However that Catch Code can not catch this unexpected exception but other Catch Code in Main catch this thing.
I think that my codes don't have bugs about this exception. So, maybe This exception is happened by TeeChart's code.
Let me know whether you would like me to help this problem. I am looking forward to a solution.
Thank you.
ref:
The points series of my TeeChart has 38000 values. (I think there are so many values in one series.)
My code is like this:
addPointsValue(_pointSeries, dblCoordinateX, dblCoordinateY,
AppData.getColor(imaxValue, iminValue, dblValue), dblValue.ToString());
//AppData.getColor(double maxValue, double minValue, double value) is a function what gets a color by concerning the value's proportion between max and min)
private void addPointsValue(Points iobjPoints, double x, double y, Color ivalueColor, string istrLabel)
{
try
{
iobjPoints.Add(x, y, istrLabel, ivalueColor);
}
catch (Exception ex)
{
throw ex;
}
}
private Points _representiveSeries = null;