TeeChart 4.0.2010.27962
I am working with a chart that has 117 line series with 24480 points each. In the BeforeDrawSeries Event, I have code which uses a for...next loop to loop through the points of a few of the series. When the following If statement executes, I get an Out Of Memory exception after about 6000 to 7000 points:
Code: Select all
If TChart1.Series(WhichSeries).Item(WhichSegment - 1).Color <> Color.Transparent And TChart1.Series(WhichSeries).Item(WhichSegment).Color <> Color.Transparent Then
'Other stuff
End If
System.OutOfMemoryException was unhandled
Message="Exception of type 'System.OutOfMemoryException' was thrown."
Source="mscorlib"
StackTrace:
at System.Collections.ArrayList..ctor(Int32 capacity)
at Steema.TeeChart.Styles.ColorList..ctor(Int32 capacity, String name)
at Steema.TeeChart.Styles.ColorList..ctor(Int32 capacity)
at Steema.TeeChart.Styles.Series.get_Colors()
at Steema.TeeChart.Styles.SeriesPoint.get_Color()
at Flocis_Visualizer.ChartForm.TChart1_BeforeDrawSeries(Object sender, Graphics3D g) in C:\Documents and Settings\jay\My Documents\Visual Studio 2008\Projects\Flocis Visualizer\Flocis Visualizer\ChartForm.vb:line 1343
at Steema.TeeChart.TChart.Steema.TeeChart.IChart.DoBeforeDrawSeries()
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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at Flocis_Visualizer.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
If I tell VB to continue, it will run through several thousand more points, then give the same error again.
It happens during the first drawing of the chart after all the series are added with their Visible properties set to false.
The error does not occur with the same number of series but fewer points (about 13000).
Is there any way to figure out if this is a TeeChart problem/bug or if VB is really running out of memory?
Jay