Importing text data - many series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
dr.vodca
Newbie
Newbie
Posts: 8
Joined: Fri Oct 13, 2006 12:00 am

Importing text data - many series

Post by dr.vodca » Sun Dec 17, 2006 12:42 pm

Dear all

I'm having trouble importing data from text file. I am aware there is a tutorial on how to import ONE series from file (http://www.teechart.net/reference/modul ... cle&sid=10) but I cannot figure out how to import MULTIPLE series from a SINGLE flat file.
Would anyone have an idea or even better a sample code on how to accomplish that ?

A related problem (I probably will have to issue another thread, but I mention it here anyway as it is closely related) is how to import data not from text but from a binary file.
An example is given in the demo "BigFlatFile.exe" - but again, this is designed for only one and not multiple series.

Every help is highly appreciated.

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

Post by Narcís » Mon Dec 18, 2006 10:12 am

Hi dr. vodca,
I'm having trouble importing data from text file. I am aware there is a tutorial on how to import ONE series from file (http://www.teechart.net/reference/modul ... cle&sid=10) but I cannot figure out how to import MULTIPLE series from a SINGLE flat file.
Would anyone have an idea or even better a sample code on how to accomplish that ?
You can populate multiple series from a single text file provided you set different file columns for each series Y values.
A related problem (I probably will have to issue another thread, but I mention it here anyway as it is closely related) is how to import data not from text but from a binary file.
An example is given in the demo "BigFlatFile.exe" - but again, this is designed for only one and not multiple series.
The same would apply as in the previous question.
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

dr.vodca
Newbie
Newbie
Posts: 8
Joined: Fri Oct 13, 2006 12:00 am

Post by dr.vodca » Mon Dec 18, 2006 7:56 pm

Dear Narcís

I hate to say that, but I'm still struggeling with the basics. would you also have a little piece of code I could chew on, for adding at least 2 line series from text file (by code) ?

I would reeeealy appreciate.

cheers
stefano

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

Post by Narcís » Tue Dec 19, 2006 9:29 am

Hi stefano,

Yes, you can do something like this:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
   With SeriesTextSource1 do
    begin
      HeaderLines:=0;
      FieldSeparator:=',';
      Fields.Clear;
      AddField('X',1);
      AddField('Bar',2);
      AddField('Text',4);
      Series:=Series1;
      LoadFromFile('c:\temp\test.txt');
    end;

   With SeriesTextSource2 do
    begin
      HeaderLines:=0;
      FieldSeparator:=',';
      Fields.Clear;
      AddField('X',1);
      AddField('Bar',3);
      AddField('Text',4);
      Series:=Series2;
      LoadFromFile('c:\temp\test.txt');
    end;
end;
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

dr.vodca
Newbie
Newbie
Posts: 8
Joined: Fri Oct 13, 2006 12:00 am

Post by dr.vodca » Tue Dec 19, 2006 5:14 pm

Hi Narcis

Thanks, this is a hint - now I understand that with seriestextsource it is necessary to create a new "source" for every series. I was presuming that you could accomplish that with only one.

Cheers
Stefano

Post Reply