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

  1. unit Contour_Levels;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, TeEngine, TeeSurfa, ExtCtrls, TeeProcs, Chart, StdCtrls;
  8.  
  9. type
  10.   TContourLevels = class(TBaseForm)
  11.     Series1: TContourSeries;
  12.     CheckBox1: TCheckBox;
  13.     procedure FormCreate(Sender: TObject);
  14.     procedure CheckBox1Click(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.     Procedure AddCustomLevels;
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. implementation
  23.  
  24. {$R *.DFM}
  25.  
  26. procedure TContourLevels.FormCreate(Sender: TObject);
  27. begin
  28.   inherited;
  29.   Series1.FillSampleValues(20);
  30.   AddCustomLevels;
  31. end;
  32.  
  33. procedure TContourLevels.CheckBox1Click(Sender: TObject);
  34. begin
  35.   Series1.AutomaticLevels:=not CheckBox1.Checked;
  36.   if not Series1.AutomaticLevels then AddCustomLevels;
  37. end;
  38.  
  39. Procedure TContourLevels.AddCustomLevels;
  40. begin
  41.   Series1.NumLevels:=10;
  42.   Series1.CreateAutoLevels;
  43.   With Series1.Levels do
  44.   begin
  45.     Items[0].UpToValue:=-1;
  46.     Items[1].UpToValue:=-0.8;
  47.     Items[2].UpToValue:=-0.6;
  48.     Items[3].UpToValue:=-0.4;
  49.     Items[4].UpToValue:=-0.2;
  50.     Items[5].UpToValue:= 0;
  51.     Items[6].UpToValue:= 0.2;
  52.     Items[7].UpToValue:= 0.4;
  53.     Items[8].UpToValue:= 0.6;
  54.     Items[9].UpToValue:= 0.8;
  55.   end;
  56. end;
  57.  
  58. initialization
  59.   RegisterClass(TContourLevels);
  60. end.
  61.