Page 1 of 1

fastline.Add(x, y) // x is uint[] and y is double[] Exceptio

Posted: Fri Feb 25, 2005 8:03 pm
by 8119975
I am using a FastLine Series to plot arrays of data. When I try to do fastline.Add(x, y) (where x is uint[] and y is double[]) I get the following:
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.ValueList.CalcStats()
at Steema.TeeChart.Styles.ValueList.get_Maximum()
at Steema.TeeChart.Styles.Series.MaxXValue()
at Steema.TeeChart.Chart.InternalMinMax(Axis aAxis, Boolean isMin, Boolean isX)
at Steema.TeeChart.Axis.CalcMinMax(Double& min, Double& max)
at Steema.TeeChart.Axis.AdjustMaxMin()
at Steema.TeeChart.Axes.AdjustMaxMin()
at Steema.TeeChart.Chart.CalcAxisRect()
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.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

If I now create a double[] x_d and copy x (uint[]) into x_d then do fastline.Add(x_d, y) everything works fine.

I also tried converting x to a long[] which gave me the same exception.

Do the arrays have to be double[] or float[] and do the types for x, and y have to match?

Posted: Mon Feb 28, 2005 12:53 pm
by narcis
Hi Digital,
If I now create a double[] x_d and copy x (uint[]) into x_d then do fastline.Add(x_d, y) everything works fine.

I also tried converting x to a long[] which gave me the same exception.

Do the arrays have to be double[] or float[] and do the types for x, and y have to match?
The errors happens because there's no Add(...) overload which supports uint[]. The types have to match to one of the multiple Add(...) overloads.

Future Plans

Posted: Mon Feb 28, 2005 2:27 pm
by 8119975
Do have any plans to support long[] in the future? Do you have any plans for a Generic Version of this method when the .Net 2.0 Framework is released.

Posted: Mon Feb 28, 2005 2:51 pm
by narcis
Hi Digital,

no, I have added this to our wish list to be considered for future releases. Meanwhile you can use the Convert.To... method which is a .NET method.

Thanks

Posted: Mon Feb 28, 2005 3:13 pm
by 8119975
Ok thank you for you help.