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

  1. {*********************************************}
  2. { TeeChart Delphi Component Library           }
  3. { Depth Axis Demo                             }
  4. { Copyright (c) 1995-1998 by David Berneda    }
  5. { All rights reserved                         }
  6. {*********************************************}
  7. unit UDepAx;
  8.  
  9. interface
  10.  
  11. uses
  12.   WinProcs,WinTypes, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  13.   StdCtrls, TeeSurfa, TeePoin3, TeEngine, Series, TeeProcs, Chart,
  14.   TeeComma, ExtCtrls;
  15.  
  16. type
  17.   TDepthAxisForm = class(TForm)
  18.     Panel1: TPanel;
  19.     Memo1: TMemo;
  20.     Button1: TButton;
  21.     TeeCommander1: TTeeCommander;
  22.     Chart1: TChart;
  23.     Series1: TLineSeries;
  24.     Series2: TLineSeries;
  25.     Series3: TLineSeries;
  26.     Series4: TPoint3DSeries;
  27.     CheckBox1: TCheckBox;
  28.     CheckBox2: TCheckBox;
  29.     CheckBox3: TCheckBox;
  30.     procedure FormCreate(Sender: TObject);
  31.     procedure CheckBox1Click(Sender: TObject);
  32.     procedure CheckBox2Click(Sender: TObject);
  33.     procedure Button1Click(Sender: TObject);
  34.     procedure CheckBox3Click(Sender: TObject);
  35.   private
  36.     { Private declarations }
  37.   public
  38.     { Public declarations }
  39.   end;
  40.  
  41. implementation
  42.  
  43. {$R *.DFM}
  44.  
  45. procedure TDepthAxisForm.FormCreate(Sender: TObject);
  46. begin
  47.   Series1.FillSampleValues(50);
  48.   Series2.FillSampleValues(50);
  49.   Series3.FillSampleValues(50);
  50.   Series4.FillSampleValues(50);
  51. end;
  52.  
  53. procedure TDepthAxisForm.CheckBox1Click(Sender: TObject);
  54. begin
  55.   { Show or hide the Depth axis }
  56.   Chart1.DepthAxis.Visible:=CheckBox1.Checked;
  57.  
  58.   { Enable / disable the "grid" checkbox }
  59.   CheckBox3.Enabled:=CheckBox1.Checked;
  60. end;
  61.  
  62. procedure TDepthAxisForm.CheckBox2Click(Sender: TObject);
  63. begin
  64.   { We show / hide a Point3D series to make change
  65.     the Depth axis from showing Series names to show
  66.     Z values.
  67.   }
  68.   if CheckBox2.Checked then
  69.   begin
  70.     Series4.Active:=False;
  71.     Series1.Active:=True;
  72.     Series2.Active:=True;
  73.     Series3.Active:=True;
  74.     { change the Font size }
  75.     Chart1.DepthAxis.LabelsFont.Size:=10;
  76.     Chart1.DepthAxis.LabelsFont.Color:=clNavy;
  77.   end
  78.   else
  79.   begin
  80.     Series4.Active:=True;
  81.     Series1.Active:=False;
  82.     Series2.Active:=False;
  83.     Series3.Active:=False;
  84.     { change the Font size }
  85.     Chart1.DepthAxis.LabelsFont.Size:=8;
  86.     Chart1.DepthAxis.LabelsFont.Color:=clMaroon;
  87.   end
  88. end;
  89.  
  90. procedure TDepthAxisForm.Button1Click(Sender: TObject);
  91. begin
  92.   Close;
  93. end;
  94.  
  95. procedure TDepthAxisForm.CheckBox3Click(Sender: TObject);
  96. begin
  97.   { We can change any axis property, like
  98.     axis Grid lines }
  99.   Chart1.DepthAxis.Grid.Visible:=CheckBox3.Checked;
  100. end;
  101.  
  102. end.
  103.