The following code throws a runtime error from TeeChart.dll:
Code: Select all
public Form1()
{
InitializeComponent();
InitChart();
}
private void InitChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
int[] XVals = { 0, 2, 4, 6, 8 };
int[] YVals = { 0, 1, 4, 9, 16};
object[] YVals2 = { 0, 1, 4, 9, 16};
Line line1 = new Line();
line1.Add(XVals, YVals2);
tChart1.Series.Add(line1);
}
"An unhandled exception of type 'System.NullReferenceException' occurred in TeeChart.dll
Additional information: Object reference not set to an instance of an object."
Please note that the code above works just fine when I use int[] instead of object[].
I'm using C# .NET 2005 and TeeChart Pro Version 2.0.2306.26232.
Thanks in advance.