AddArray in 3D Chart
Posted: Wed Oct 08, 2008 9:23 am
Hi,
I have TeeChat 8.02 and I'm trying to use AddArray with a 3D tower chart but I fail miserably. I had a look at the code example in the demo "Series3D_AddArray.cpp" and I see that it's using a TArrayGrid to pass all data. My problem is that I need to use a pointer to a double and even if the method is available it seems that the series is taking the data as a continuos dataset: it does not count rows or columns (the method asks for the number of values).
Could you please tell me if the only method is the TArrayGrid or if there is something wrong? I add the code at the bottom of the message.
Thanks a lot
Nicola
code
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TArrayGrid A;
double *arr;
arr=new double[30];
// initialize dynamic array grid
A.Length =5;
for (int t=0; t<A.Length-1;t++) A[t].Length = 7;
// fill with random values
int k=0;
for (int x=0;x<4;x++)
for (int z=0;z<6;z++){
A[x][z] = sqrt(pow(x,2)+pow(z-3,2)) ;
arr[k++]=A[x][z];
}
// add to 3D series:
// Series1->AddArray(A);
Series1->AddArray(arr,30);
}
I have TeeChat 8.02 and I'm trying to use AddArray with a 3D tower chart but I fail miserably. I had a look at the code example in the demo "Series3D_AddArray.cpp" and I see that it's using a TArrayGrid to pass all data. My problem is that I need to use a pointer to a double and even if the method is available it seems that the series is taking the data as a continuos dataset: it does not count rows or columns (the method asks for the number of values).
Could you please tell me if the only method is the TArrayGrid or if there is something wrong? I add the code at the bottom of the message.
Thanks a lot
Nicola
code
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TArrayGrid A;
double *arr;
arr=new double[30];
// initialize dynamic array grid
A.Length =5;
for (int t=0; t<A.Length-1;t++) A[t].Length = 7;
// fill with random values
int k=0;
for (int x=0;x<4;x++)
for (int z=0;z<6;z++){
A[x][z] = sqrt(pow(x,2)+pow(z-3,2)) ;
arr[k++]=A[x][z];
}
// add to 3D series:
// Series1->AddArray(A);
Series1->AddArray(arr,30);
}