Page 1 of 1

DATA or OBJECT

Posted: Tue Aug 31, 2010 8:52 pm
by 10548769
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

Re: DATA or OBJECT

Posted: Wed Sep 01, 2010 5:14 pm
by yeray
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;

Re: DATA or OBJECT

Posted: Wed Sep 01, 2010 5:36 pm
by 10548769
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

Re: DATA or OBJECT

Posted: Wed Sep 01, 2010 6:20 pm
by 10548769
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.

Re: DATA or OBJECT

Posted: Thu Sep 02, 2010 3:52 pm
by yeray
Hi GoToXY,

I've added your request to the wish list to be implemented in future releases (TV52015136)

Re: DATA or OBJECT

Posted: Thu Sep 02, 2010 3:53 pm
by 10548769
thanks a lot, i really appreciate it