How to display large C++ arrays with TeeChart?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Manu
Newbie
Newbie
Posts: 3
Joined: Tue Jul 08, 2014 12:00 am

How to display large C++ arrays with TeeChart?

Post by Manu » Fri Sep 26, 2014 11:11 am

Hello,

We are currently in the process of moving our legacy application from C++ Builder 5 to C++ Builder XE2.
The program internally stores a lot of data in simple C++ arrays. These arrays need to be visualized by TeeChart.
Since the arrays are rather big (>60.000 values per array) we don't want to make duplicates for performance reasons.
In the version of TeeChart distributed with C++ Builder 5 we solved the issue by subclassing the TChartValueList (making it work on our internal array) and replacing the one that was present in the Series like so:

Code: Select all

TMyList* newlist = new TMyList(Aseries,"X");
Aseries->ReplaceList(Aseries->XValues,newlist);
This 'trick' doesn't seem to work anymore with the TeeChart version in C++ Builder XE2. Altough the code compiles and gives no errors, not all our subclassed functions get called anymore. Especially the function TChartValueList::GetValue(int ValueIndex). Probably because the function isn't virtual anymore.

So my next question is rather obvious: what can I do to solve this problem? I'd rather not change the internal representation of the data as this would cause a lot of code rewriting.

TIA

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to display large C++ arrays with TeeChart?

Post by Yeray » Fri Sep 26, 2014 1:31 pm

Hello,

Could you please tell us between what TeeChart version have you noticed the difference?
I read you are moving from C++Builder 5 to C++Builder XE2, but what TeeChart versions do you have installed in both IDEs?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Manu
Newbie
Newbie
Posts: 3
Joined: Tue Jul 08, 2014 12:00 am

Re: How to display large C++ arrays with TeeChart?

Post by Manu » Mon Sep 29, 2014 8:03 am

version used in C++ Builder 5: TeeChart Pro 4.02
version used in C++ Builder XE2: TeeChart Standard v2011.05.120301 32 bit

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to display large C++ arrays with TeeChart?

Post by Yeray » Mon Sep 29, 2014 2:27 pm

Hello,

This changed a long time ago to directly access the Value array instead of using Items property.
However, you can still assign the array directly. Ie:

Code: Select all

void __fastcall TForm2::FormCreate(TObject *Sender)
{
  TDoubleDynArray data;

  data.Length=3;

  data[0]=6;
  data[1]=7;
  data[2]=8;

  Series1->YValues->Value = data;

  Series1->XValues->Count = 3;
  Series1->YValues->Count = 3;
}
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Manu
Newbie
Newbie
Posts: 3
Joined: Tue Jul 08, 2014 12:00 am

Re: How to display large C++ arrays with TeeChart?

Post by Manu » Mon Sep 29, 2014 2:51 pm

Yes, but now our internal data arrays will need to be changed to ' TDoubleDynArrays' just to be able to assign them to 'Values'. Currently they are just C arrays.
The compiler just won't allow me to assign a simple C array to Values.
Is there any workaround?

Post Reply