【发布时间】:2015-10-19 19:56:11
【问题描述】:
在我正在构建的测试应用程序中,我在尝试绘制图表时遇到了这个错误。我有一些伪随机生成的数据在尝试绘制甘特图时导致我的测试应用程序崩溃...
System.ArgumentOutOfRangeException 未处理 HResult=-2146233086 消息=索引超出范围。必须是非负数且小于 集合的大小。参数名称:index ParamName=index 来源=mscorlib StackTrace:在 System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument 参数,ExceptionResource 资源)在 Steema.TeeChart.Styles.Gantt.CopyNextTasks() 在 Steema.TeeChart.Styles.Gantt.Draw() 在 Steema.TeeChart.Styles.Series.DrawSeries() 在 Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc) 在 Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g) 在 Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools) at Steema.TeeChart.Chart.InternalDraw(Graphics g) 在 Steema.TeeChart.TChart.Draw(Graphics g) at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe) 在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 层)在 System.Windows.Forms.Control.WmPaint(Message& m) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(消息& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(消息& m) 在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) InnerException:
它似乎在 TeeChart 甘特图绘制逻辑中下降。
我的项目在这里:https://www.dropbox.com/sh/haqspd4ux41n2uf/AADkj2H5GLd09oJTW-HrAVr3a?dl=0
如果有人想复制它。
此测试代码在旧 2.0.2670.26520 版本的 TeeChart 上确实可以正确执行。
似乎我的错误可能与此处描述的错误有关: Exception and endlessly growing designer generated code in InitializeComponent when using Steema TeeChart for .NET 2013 4.1.2013.05280 - What to do?
任何关于解决它的想法或建议将不胜感激。
【问题讨论】:
标签: c# indexoutofboundsexception teechart gantt-chart