procedure
TForm1.Button1Click(Sender: TObject);
Var
{
A file a sequence of elements of the same type.
Standard I/O routines use the predefined TextFile or
Text type, which represents a file containing
characters
organized into lines. }
Data
: TextFile;
X,
Y : Real;
begin
{
This method deletes all Series values.
Dependent Series are notified. If no new points are
appended to the Series, nothing will be painted.
}
Chart1.Series[0].Clear;
{
Associates the name of an external file with a file variable.
}
AssignFile(Data,
Edit1.Text);
{
Opens an existing file. }
Reset(Data);
{
EOF - Tests whether the file position is at the end of a file.
}
While
Not Eof(Data) Do
Begin
{
Reads a line of text from a file. }
Readln(Data,
X, Y);
Chart1.Series[0].AddXY(X,
Y, '', clTeeColor);
End;
{
Closes a file. }
CloseFile(Data);
end;