TSeriesTextSource.AddField
TSeriesTextSource
function AddField(Const AName: String; AIndex: Integer): TSeriesTextField;
Unit
TeeSeriesTextEd
Description
Use AddField to add a field a the text source file. The Field name should coincide with the name used to define the value in the Series ValueList. The name of the column is not important in the text file of origin but note that the index of the first column starts at 1.
Example
Data text file 'c:\tempdata\testcandledata.txt':
Date,Open,High,Low,Close
1/1/2000,15,76,7,40
2/1/2000,40,55,35,37
3/1/2000,37,61,29,43
{Load data with the following code:}
procedure TForm1.Button1Click(Sender: TObject);
var colcount: integer;
begin
With SeriesTextSource1 do
Begin
Series:=Series1;
Filename:='c:\tempdata\testcandledata.txt';
Headerlines:=1;
For colcount:=0 to Series1.ValuesList.Count-1 do
begin
SeriesTextSource1.AddField(Series1.ValuesList[colcount].Name,colcount+1);
end;
Active:=True;
end;
end;