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 happens when I use Scatter Chart and DataTable as Data Source.
1) Get all Chart Data, and populate into DataTable. (for loop with the below line to populate data into table)
_chartDataTable.Rows.Add(
new object[] { factorData.FactorName, factorData.x.Value, factorData.y.Value });
2) Bind the data to Chart
_chart.DataSource = _chartDataTable;
_chart.DataBind();
3) Then, on the next plot, clear DataTable Before getting new Data.
_chart.ResetDataSource();
_chartDataTable.Clear();
4) Get All Chart Data (for next plot), and populate into DataTable.(for loop with the below line to populate data into table)
5) Bind the data to Chart
It looks like the data is being plotted on chart while performing the action on 4) although _chart.DataSource is null and haven't called DataBind() yet. And it is at this point the below exception happens.
System.IndexOutOfRangeException: There is no row at position 1300. at System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) at System.Data.RBTree`1.get_Item(Int32 index) at System.Data.DataRowCollection.get_Item(Int32 index) at Infragistics.UltraChart.Data.DataTableToChartAdapter.GetObjectValue(Int32 row, Int32 column) at Infragistics.UltraChart.Data.ChartDataFilter.GetObjectValue(Int32 row, Int32 column) at Infragistics.UltraChart.Data.ChartDataAdapter.calculateMinMax(Boolean treatNullAsZero) at Infragistics.UltraChart.Data.ChartDataAdapter.ReCalculateMinMax(Boolean treatNullAsZero) at Infragistics.UltraChart.Core.Layers.TwoDGridLayer.FillSceneGraph(SceneGraph scene, Boolean includeXAxes, Boolean includeYAxes) at Infragistics.UltraChart.Core.Layers.TwoDGridLayer.FillSceneGraph(SceneGraph scene) 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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
No, this problem seems unrelated. Can you provide a sample or steps to reproduce this?
Is this also related to Scatter Chart with Data Table?
I am getting the following:
System.IndexOutOfRangeException: There is no row at position 841. at System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) at System.Data.RBTree`1.get_Item(Int32 index) at System.Data.DataRowCollection.get_Item(Int32 index) at Infragistics.UltraChart.Data.DataTableToChartAdapter.GetObjectValue(Int32 row, Int32 column) at Infragistics.UltraChart.Data.ChartDataFilter.GetObjectValue(Int32 row, Int32 column) at Infragistics.UltraChart.Core.Layers.ScatterLayer.FillSceneGraph(SceneGraph scene) 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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
This turned out to be a bug, and I've just fixed it, so you shouldn't see the exception being thrown in the next available hotfix. If you need to inquire about the status of this bug in the future, please send an email to developer support (http://ko.infragistics.com/gethelp) and ask about BR34737. As a workaround, you'll have to somehow intercept the data if it's all null before it's bound to the chart or use InterpolateCustom instead of InterpolateSimple and resolve the null values manually.