home *** CD-ROM | disk | FTP | other *** search
- unit usurfa;
-
- { This example shows how to connect a Surface series to
- a database Table.
-
- First copy the surface.db example data file to DBDEMOS
- alias ( \delphi\demos\data folder ).
-
- Using the Chart editor, you should connect the Surface
- series to the corresponding X,Y and Z fields in the
- dataset.
-
- The database records should contain all possible values
- for X by Z cells. ( NumXValues by NumZValues )
- }
-
- interface
-
- uses
- WinTypes, WinProcs, Messages, SysUtils, Classes, Graphics, Controls, Forms,
- Dialogs, Db, DBTables, TeEngine, TeeSurfa, ExtCtrls, TeeProcs, Chart,
- DBChart, StdCtrls, TeeComma;
-
- type
- TTableSurfaceForm = class(TForm)
- DBChart1: TDBChart;
- Series1: TSurfaceSeries;
- Table1: TTable;
- Button1: TButton;
- Label1: TLabel;
- CheckBox1: TCheckBox;
- TeeCommander1: TTeeCommander;
- procedure CheckBox1Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- TableSurfaceForm: TTableSurfaceForm;
-
- implementation
-
- {$R *.DFM}
- uses dbeditch;
-
- procedure TTableSurfaceForm.CheckBox1Click(Sender: TObject);
- begin
- With Series1 do
- begin
- NumXValues:=10;
- NumZValues:=10;
- XValues.ValueSource:='X';
- YValues.ValueSource:='Y';
- ZValues.ValueSource:='Z';
- DataSource:=Table1;
- end;
-
- Table1.Active:=CheckBox1.Checked;
- end;
-
- procedure TTableSurfaceForm.Button1Click(Sender: TObject);
- begin
- Close;
- end;
-
- end.
-