unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeEngine, Series, ArrowCha, TeeDBEdit, TeeDBCrossTab, DB,
  TeeData, TeeSeriesTextEd, TeeURL, TeeXML, ExtCtrls, TeeProcs, Chart,
  TeeEdit, StdCtrls;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    TeeXMLSource1: TTeeXMLSource;
    Button1: TButton;
    Panel3: TPanel;
    Memo1: TMemo;
    Chart1: TChart;
    Series1: TPointSeries;
    SeriesTextSource1: TSeriesTextSource;
    Memo2: TMemo;
    Button2: TButton;
    Edit1: TEdit;
    Button3: TButton;
    Panel4: TPanel;
    DBCrossTabSource1: TDBCrossTabSource;
    Button4: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
F:TextFile;
S:string;
i:Integer;
begin     //XMLÑÝÊ¾
Memo1.Align := alLeft;
Memo1.Visible := true;
Chart1.Align := alClient;
Memo2.Visible := false;

TeeXMLSource1.Active := false;
Memo1.Refresh;
AssignFile(F, 'wby.xml'); { File selected in dialog }
Rewrite(F);
for i:= 0 to Memo1.Lines.Count-1 do
     Writeln(F, Memo1.Lines[i]);                        { Read first line of file }
CloseFile(F);
TeeXMLSource1.Chart := Chart1;
TeeXMLSource1.FileName := 'wby.xml';
TeeXMLSource1.Series := Series1;
TeeXMLSource1.ValueSource := 'Y';
TeeXMLSource1.Active := true;
end;


procedure TForm1.Button2Click(Sender: TObject);
var
F:TextFile;
S:string;
i:Integer;
begin           //TXTÑÝÊ¾
Memo2.Align := alLeft;
Memo2.Visible := true;
Chart1.Align := alClient;
Memo1.Visible := false;

SeriesTextSource1.Active := false;
Memo2.Refresh;
AssignFile(F, 'wby.txt'); { File selected in dialog }
Rewrite(F);
for i:= 0 to Memo2.Lines.Count-1 do
     Writeln(F, Memo2.Lines[i]);                        { Read first line of file }
CloseFile(F);
SeriesTextSource1.FileName := 'wby.txt';
SeriesTextSource1.Series := Series1;
SeriesTextSource1.HeaderLines := 2;
SeriesTextSource1.FieldSeparator := ',';
SeriesTextSource1.Active := true;
end;


procedure TForm1.Button3Click(Sender: TObject);
begin
Memo1.Align := alLeft;
Memo1.Visible := true;
Chart1.Align := alClient;
Memo2.Visible := false;
TeeXMLSource1.Chart := Chart1;
TeeXMLSource1.Series := Series1;
TeeXMLSource1.ValueSource := 'Y';
TeeXMLSource1.LoadFromURL('http://www.steema.com/SampleData.xml');
TeeXMLSource1.Active := TRUE;
TeeXMLSource1.Refresh;
Chart1.Refresh;
end;

end.
