Hi,
I'm running into a problem using a data bound NumericTimeSeries and using NullHandling.InterpolateSimple. The data in the DataTable being used contains all nulls, and this appears to cause a problem.
Is there a property or setting that I'm missing that prevents this exception from getting thrown?
I realize that I could do some work ahead of time to detect if the chart's values are all null, and not create the chart layer or something like that, but the chart is part of a dynamic data source which allows the changing of the underlying chart data on the fly. If the user set some values to null after the initial detection, I would have to recreate the entire chart to do the null checking all over again.
Please advise on the best way to proceed.
FYI, I'm using version 8.1.20081.1000 of Infragistics2.Win.UltraWinChart.v8.1.
Exception Text Below:
---------------------------
---------------------------System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices)
at System.Array.GetValue(Int32 index1, Int32 index2)
at Infragistics.UltraChart.Core.Layers.ChartLayer.InterpolateSimple(InterpolateValuesEventArgs e)
at Infragistics.UltraChart.Core.Layers.ChartLayer.InterpolateNumericTimeValues(PrimitiveCollection primitives, Type type, ChartLayer layer)
at Infragistics.UltraChart.Core.Layers.LineLayer.InterpolateValues(PrimitiveCollection primitives, Type type, Int32 arrayWidth)
at Infragistics.UltraChart.Core.Layers.ChartLayer.InterpolatePrimitives(PrimitiveCollection primitives, Type type, Int32 arrayWidth)
at Infragistics.UltraChart.Core.Layers.LineLayer.FillSceneGraph(SceneGraph scene)
at Infragistics.UltraChart.Resources.Appearance.ChartArea.FillSceneGraph(SceneGraph scene, IChartComponent chartComponent, ChartCore core)
at Infragistics.UltraChart.Core.ChartCore.DrawComposite()
at Infragistics.UltraChart.Core.ChartCore.DrawChart()
at Infragistics.Win.UltraWinChart.UltraChart.OnPaint(PaintEventArgs e)
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.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.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)
This is a bit puzzling and will be extremely difficult to reproduce without a running sample. If you can provide such a sample, that would be great. In the meantime, try making calls to chart binding mutually exclusve. If you can have an event that gets triggered only once all the data is available, that might help, too.
It happens while doing step 4, so before assigning the data table as data source. (And I saw the chart being drawn even before data table was assigned.)
I am using multiple threads to get the data, but when I populate the data table, it is on only one thread.
I have event hander which receives the data. If I expect 5 data, this event handler is called 5 times, and it is at 5th time, I populate data table and assign to chart's data source.
Which events trigger steps 1-5 when you're getting the IOR exception? Is the data already displayed on the chart before you start step 3? Typically, there is no need to call DataBind() after assigning a datasource (only for win chart), but the new data shouldn't be rendered until the datasource is assigned. Is there a chance you're doing this on multiple threads?
RenderSceneGraph will be called every time the chart is being re-drawn. The last few posts make me believe even more that you're using multiple threads to populate the charts, which shouldn't be done.
I am adding image that results from both of the above 2 issues
As a separate issue from the above, I am also getting the below exception while populating data table.
Can you tell me why RenderSceneGraph is called?
Unhandled Thread Exception, Exception
='System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext() at Infragistics.UltraChart.Render.ChartRender.RenderSceneGraph(SceneGraph scene, Graphics g, Boolean chartDrawItem) at Infragistics.UltraChart.Render.ChartRender.RenderSceneGraph(SceneGraph scene, Graphics g) at Infragistics.Win.UltraWinChart.UltraChart.OnPaint(PaintEventArgs e) 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.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.UserControl.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)' (Loader.Unhandled Thread Exception)
OR
='System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.Collections.ArrayList.ArrayListEnumeratorSimple.Reset() at Infragistics.UltraChart.Render.ChartRender.RenderSceneGraph(SceneGraph scene, Graphics g, Boolean chartDrawItem) at Infragistics.UltraChart.Render.ChartRender.RenderSceneGraph(SceneGraph scene, Graphics g) at Infragistics.Win.UltraWinChart.UltraChart.OnPaint(PaintEventArgs e) 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.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.UserControl.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)' (Loader.Unhandled Thread Exception)