AddArray in 3D Chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
buonni
Newbie
Newbie
Posts: 1
Joined: Thu Mar 13, 2008 12:00 am

AddArray in 3D Chart

Post by buonni » 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);

}

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Oct 08, 2008 9:59 am

Hi buonni,

In that case you can try doing as shown in the Real-time Charting article available here. You'll also find a C++ Builder example in the Series_ValueList.cpp example.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply