home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / TEECHART / Delphi1_And_Delphi2 / EXAMPLES / DATABASE / USURFA.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-10-24  |  1.5 KB  |  70 lines

  1. unit usurfa;
  2.  
  3. { This example shows how to connect a Surface series to
  4.   a database Table.
  5.  
  6.   First copy the surface.db example data file to DBDEMOS
  7.   alias ( \delphi\demos\data folder ).
  8.  
  9.   Using the Chart editor, you should connect the Surface
  10.   series to the corresponding X,Y and Z fields in the
  11.   dataset.
  12.  
  13.   The database records should contain all possible values
  14.   for X by Z cells.  ( NumXValues by NumZValues )
  15. }
  16.  
  17. interface
  18.  
  19. uses
  20.   WinTypes, WinProcs, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  21.   Dialogs, Db, DBTables, TeEngine, TeeSurfa, ExtCtrls, TeeProcs, Chart,
  22.   DBChart, StdCtrls, TeeComma;
  23.  
  24. type
  25.   TTableSurfaceForm = class(TForm)
  26.     DBChart1: TDBChart;
  27.     Series1: TSurfaceSeries;
  28.     Table1: TTable;
  29.     Button1: TButton;
  30.     Label1: TLabel;
  31.     CheckBox1: TCheckBox;
  32.     TeeCommander1: TTeeCommander;
  33.     procedure CheckBox1Click(Sender: TObject);
  34.     procedure Button1Click(Sender: TObject);
  35.   private
  36.     { Private declarations }
  37.   public
  38.     { Public declarations }
  39.   end;
  40.  
  41. var
  42.   TableSurfaceForm: TTableSurfaceForm;
  43.  
  44. implementation
  45.  
  46. {$R *.DFM}
  47. uses dbeditch;
  48.  
  49. procedure TTableSurfaceForm.CheckBox1Click(Sender: TObject);
  50. begin
  51.   With Series1 do
  52.   begin
  53.     NumXValues:=10;
  54.     NumZValues:=10;
  55.     XValues.ValueSource:='X';
  56.     YValues.ValueSource:='Y';
  57.     ZValues.ValueSource:='Z';
  58.     DataSource:=Table1;
  59.   end;
  60.  
  61.   Table1.Active:=CheckBox1.Checked;
  62. end;
  63.  
  64. procedure TTableSurfaceForm.Button1Click(Sender: TObject);
  65. begin
  66.   Close;
  67. end;
  68.  
  69. end.
  70.