Page 1 of 1

Paging crashes in ColorGrid

Posted: Wed Aug 09, 2006 12:52 pm
by 9637288
Hi,

I'm trying to set up a colorgrid with paging.

First problem is actually with property page, it doesn't allow more than 32000 points / page, but I can manage that by setting it in program.

But when browsing the pages the component crashes after a few pages, for example with 200 * 7000 grid, max points 80000, it crashes after 4th page. With max points 100000 it crashes after 3rd page.

(The same problem occurs also if I stay with the max 32000 allowed by property pages)

Here's the exception:

System.ArgumentOutOfRangeException was unhandled
Message="Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"
ParamName="index"
Source="mscorlib"
StackTrace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Steema.TeeChart.Styles.Custom3DGrid.get_Item(Int32 x, Int32 z)
at Steema.TeeChart.Styles.ColorGrid.Clicked(Int32 x, Int32 y)
at Steema.TeeChart.Styles.ColorGrid.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.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(Form mainForm)
at FXtester.protoMenu.Main() in C:\Prototypes\FXtester\protoMenu.vb:line 1
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()

Posted: Thu Aug 10, 2006 8:29 am
by Chris
Hello,

This happens because all Custom3DGrid series (ColorGrid, Contour, Surface, Tower etc.) are limited to 2000 cells.

Running higher numbers of cells, that is, incrementing the private const MaxAllowedCells, causes your code to execute without an error but makes for an application that is so slow to paint that it is impracticable.

Posted: Thu Aug 10, 2006 9:12 am
by 9637288
Hello,

I suppose setting the MaxAllowedCells from program is not possible ?

The performance depends more on how many cells are
rendered at one time, not how many cells there are, so by paging the
data performance remains acceptable.

Also, the 2000 limitation seems to be the limitation per dimension because
i can set up a 2000x2000 grid = 4 million cells but not a 10 * 2001 grid.
Even my example with 200 * 7000 cells would be only 1,4 million total.

Posted: Thu Aug 10, 2006 9:16 am
by 9637288
One more thing, would you happen to have an example how to use paging in ASP.NET with WebChart ?

Posted: Thu Aug 10, 2006 9:38 am
by Chris
Hello,
I suppose setting the MaxAllowedCells from program is not possible ?
No, I'm afraid not, as it's private and it's a const.
Also, the 2000 limitation seems to be the limitation per dimension because
i can set up a 2000x2000 grid = 4 million cells but not a 10 * 2001 grid.
Even my example with 200 * 7000 cells would be only 1,4 million total.
Yes, it's the limit of the grid (X,Z) size, that is, (2000, 2000). Your example of (200, 7000) would therefore pass this limit.
One more thing, would you happen to have an example how to use paging in ASP.NET with WebChart ?
I'm afraid I don't have one to hand, sorry. I'm sure the web examples shipped with TeeChart for .NET will give you a good start and if you encounter problems along the way we'll always be here to help you in any way we can.