Nevron Forum

Red cross instead of chart

https://www.nevron.com/Forum/Topic6637.aspx

By Alina Voskova - Thursday, June 28, 2012

Hello.
Sometimes instead of chart appears the red cross - see the attachment. I can't reproduce it stable, so I'm not able to provide code example here. Could you tell me, which reason may be for such behavior?
By Nevron Support - Thursday, June 28, 2012

Hi Ereona,

Please provide more information - what is the platform, control verstion, are there any exceptions etc...

By Alina Voskova - Thursday, June 28, 2012

Dll's version is 12.5.9.12, OS is Windows 7. Unfortunately I can't tell anything about exceptions because this error reproduces only on user's PC so far.
By Nevron Support - Friday, June 29, 2012

Hi Ereona,

We'll need some code or application that reproduces the problem or stack trace of the generated exception to further investigate this issue.

By Alina Voskova - Wednesday, July 18, 2012

Here are stack traces for two exceptions which happen during chart repainting. How to avoid them?


> mscorlib.dll!System.Collections.ArrayList.this[int].get(int index) + 0x74 bytes
Nevron.Chart.dll!Nevron.Chart.NContentPanel.RecalcChildPanelsLayout(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0x158 bytes
Nevron.Chart.dll!Nevron.Chart.NContentPanel.RecalcLayout(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0x32 bytes
Nevron.Chart.dll!Nevron.Chart.NRootPanel.RecalcLayout(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0x196 bytes
Nevron.Chart.dll!Nevron.Chart.NDocument.RecalcLayout(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0x15d bytes
Nevron.Chart.dll!Nevron.Chart.NDocument.Paint(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}, bool l1ll111l11I = false, bool recalc = true) + 0xa2 bytes
Nevron.Chart.dll!Nevron.Chart.l1II11IlIl.PaintContent() + 0x3b bytes
Nevron.Presentation.dll!Nevron.GraphicsCore.NBitmapGdiRenderSurface.Paint(object sender = {Nevron.Chart.WinForm.NChartControl}, System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}, Nevron.GraphicsCore.l1ll11Il1 contentPainter = {Nevron.Chart.l1II11IlIl}) + 0x7c bytes
Nevron.Chart.dll!Nevron.Chart.WinForm.NControlView.Paint(object sender = {Nevron.Chart.WinForm.NChartControl}, System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}) + 0x12f bytes
Nevron.Chart.WinForm.dll!Nevron.Chart.WinForm.NChartControl.OnPaint(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}) + 0x3d bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e, short layer) + 0xa1 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref System.Windows.Forms.Message m) + 0x342 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x2b1 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0x13 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x31 bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 15, System.IntPtr wparam, System.IntPtr lparam) + 0x64 bytes
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame = {System.Windows.Threading.DispatcherFrame}) + 0xc1 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) + 0x49 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.Run() + 0x4c bytes
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) + 0x17 bytes
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) + 0x6f bytes
PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) + 0x26 bytes
PresentationFramework.dll!System.Windows.Application.Run() + 0x1b bytes


> mscorlib.dll!System.Collections.ArrayList.this[int].get(int index) + 0x74 bytes
Nevron.Chart.dll!Nevron.Chart.NPanel.lIlIlII1ll.get() + 0x7e bytes
Nevron.Chart.dll!Nevron.Chart.WinForm.NControlView.lI1l1II1lI() + 0x9f bytes
Nevron.Chart.dll!Nevron.Chart.WinForm.NControlView.Paint(object sender = {Nevron.Chart.WinForm.NChartControl}, System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}) + 0xb4 bytes
Nevron.Chart.WinForm.dll!Nevron.Chart.WinForm.NChartControl.OnPaint(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}) + 0x3d bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e, short layer) + 0xa1 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref System.Windows.Forms.Message m) + 0x342 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x2b1 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0x13 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x31 bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 15, System.IntPtr wparam, System.IntPtr lparam) + 0x64 bytes
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame = {System.Windows.Threading.DispatcherFrame}) + 0xc1 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) + 0x49 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.Run() + 0x4c bytes
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) + 0x17 bytes
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) + 0x6f bytes
PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) + 0x26 bytes
PresentationFramework.dll!System.Windows.Application.Run() + 0x1b bytes
By Nevron Support - Wednesday, July 18, 2012

Hi Ereona,

As mentioned above you need to provide an app relicating the problem to investigate this in detail. Most likely you automate the control from a thread different than the UI main thread and that's why get those errors. If this is the case you need to ensure the chart document is protected from simultaneous access:

nChartControl1.Document.Lock();

// chart modifications go here

nChartControl1.Document.Unlock();

By Alina Voskova - Thursday, July 19, 2012

Thank you for reply.