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

  1. unit Stochastic_Function;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, TeEngine, StatChar, Series, OHLChart, CandleCh, ExtCtrls, TeeProcs,
  8.   Chart, StdCtrls, ComCtrls, TeeTools;
  9.  
  10. type
  11.   TStochasticForm = class(TBaseForm)
  12.     Series1: TCandleSeries;
  13.     Series2: TLineSeries;
  14.     TeeFunction1: TStochasticFunction;
  15.     CheckBox1: TCheckBox;
  16.     Label1: TLabel;
  17.     Edit1: TEdit;
  18.     UpDown1: TUpDown;
  19.     ChartTool1: TColorLineTool;
  20.     ChartTool2: TColorBandTool;
  21.     procedure FormCreate(Sender: TObject);
  22.     procedure CheckBox1Click(Sender: TObject);
  23.     procedure Edit1Change(Sender: TObject);
  24.   private
  25.     { Private declarations }
  26.   public
  27.     { Public declarations }
  28.   end;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. procedure TStochasticForm.FormCreate(Sender: TObject);
  35. begin
  36.   inherited;
  37.   Series1.FillSampleValues(60);
  38. end;
  39.  
  40. procedure TStochasticForm.CheckBox1Click(Sender: TObject);
  41. begin
  42.   Series2.Active:=CheckBox1.Checked;
  43.   Chart1.Legend.Visible:=CheckBox1.Checked;
  44.  
  45.   { resize the Left axis }
  46.   if CheckBox1.Checked then Chart1.LeftAxis.EndPosition:=75
  47.                        else Chart1.LeftAxis.EndPosition:=100;
  48.  
  49.   Edit1.Enabled:=CheckBox1.Checked;
  50.   UpDown1.Enabled:=CheckBox1.Checked;
  51.  
  52.   { show / hide the color band }
  53.   ChartTool1.Active:=CheckBox1.Checked;
  54.   ChartTool2.Active:=CheckBox1.Checked;
  55. end;
  56.  
  57. procedure TStochasticForm.Edit1Change(Sender: TObject);
  58. begin
  59.   TeeFunction1.Period:=UpDown1.Position
  60. end;
  61.  
  62. initialization
  63.   RegisterClass(TStochasticForm);
  64. end.
  65.