DATA or OBJECT

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

DATA or OBJECT

Post by GoToXY » Tue Aug 31, 2010 8:52 pm

Hi, i would like to know if there is a pointer property i could used to store custom information about a TChartSeries. It would be more easier for me to managed all the custom series information directly from the serie than my custom list that i have to access from a lot of forms etc... Im my project, the TChart is commun to my forms and it would be faster for me to access the ASeries.DATA (Pointer) or ASeries.Object (TObject).

Thanks a lot

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

Re: DATA or OBJECT

Post by Yeray » Wed Sep 01, 2010 5:14 pm

Hi GoToXY,

You could create a new series type that inherits from one of the series types and add as many properties as you want to it. For example:

Code: Select all

  TMyCustomBarSeries=class(TBarSeries)
  private
    MyNewProperty: Integer;
  end;

//...

procedure TForm1.FormCreate(Sender: TObject);
begin
  with Chart1.AddSeries(TMyCustomBarSeries) as TMyCustomBarSeries do
  begin
    FillSampleValues();
    MyNewProperty:=5;
  end;
end;
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

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: DATA or OBJECT

Post by GoToXY » Wed Sep 01, 2010 5:36 pm

I did modified your code by adding a DATA property of a pointer to the TChartSeries class. That way, i dont have to create all the existing kind of chart that there is in TeeChart. I already have over 1M lines of code and i dont have time to change all the types. And i still think you should add it too.

I'm sure im not the only who will need that DATA property. And doing so will be dynamic to all other software we can build after. Its like a TStringList, u can use the AddObject to link a list to an object/pointer. well, in my case, The TChart SeriesList is my main list. have a litle extra property as DATA will allow me to link anykind of object to it. So i wont have to make extra classes to fill my need for each software i would need something like that. The TTreeNode use DATA too and i really dont want to imagine creating new sub class from a TTreeNode to have custom properties.

thanks

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: DATA or OBJECT

Post by GoToXY » Wed Sep 01, 2010 6:20 pm

And by the time, if i inherite my class from an other class an you guys decide to add a new property with the same name as mine, i will have to modify my code to suit yours. That wont happend if i get my DATA property.

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

Re: DATA or OBJECT

Post by Yeray » Thu Sep 02, 2010 3:52 pm

Hi GoToXY,

I've added your request to the wish list to be implemented in future releases (TV52015136)
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

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: DATA or OBJECT

Post by GoToXY » Thu Sep 02, 2010 3:53 pm

thanks a lot, i really appreciate it

Post Reply