home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Delphi / TeeChartPro / TeeChart5Delphi5Eval.exe / %MAINDIR% / Examples / Features / Zoom_Direction.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-09-10  |  1.1 KB  |  56 lines

  1. unit Zoom_Direction;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, ExtCtrls, TeeProcs, TeEngine, Chart, StdCtrls, Series;
  8.  
  9. type
  10.   TZoomDirection = class(TBaseForm)
  11.     Label1: TLabel;
  12.     ComboBox1: TComboBox;
  13.     Series1: TLineSeries;
  14.     Label2: TLabel;
  15.     procedure ComboBox1Change(Sender: TObject);
  16.     procedure FormCreate(Sender: TObject);
  17.     procedure FormShow(Sender: TObject);
  18.   private
  19.     { Private declarations }
  20.   public
  21.     { Public declarations }
  22.   end;
  23.  
  24. var
  25.   ZoomDirection: TZoomDirection;
  26.  
  27. implementation
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TZoomDirection.ComboBox1Change(Sender: TObject);
  32. begin
  33.   inherited;
  34.   Case ComboBox1.ItemIndex of
  35.     0: Chart1.Zoom.Direction:=tzdHorizontal;
  36.     1: Chart1.Zoom.Direction:=tzdVertical;
  37.     2: Chart1.Zoom.Direction:=tzdBoth;
  38.   end;
  39. end;
  40.  
  41. procedure TZoomDirection.FormCreate(Sender: TObject);
  42. begin
  43.   inherited;
  44.   Series1.FillSampleValues(40);
  45. end;
  46.  
  47. procedure TZoomDirection.FormShow(Sender: TObject);
  48. begin
  49.   inherited;
  50.   ComboBox1.ItemIndex:=2;
  51. end;
  52.  
  53. initialization
  54.   RegisterClass(TZoomDirection);
  55. end.
  56.