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

  1. unit Axis_Custom;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, TeEngine, Series, ExtCtrls, TeeProcs, Chart, StdCtrls;
  8.  
  9. type
  10.   TAxisCustom = class(TBaseForm)
  11.     Series1: TLineSeries;
  12.     Series2: TLineSeries;
  13.     Series3: TLineSeries;
  14.     CheckBox1: TCheckBox;
  15.     Button1: TButton;
  16.     procedure FormCreate(Sender: TObject);
  17.     procedure CheckBox1Click(Sender: TObject);
  18.     procedure Button1Click(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24.  
  25. implementation
  26.  
  27. {$R *.DFM}
  28.  
  29. Uses EditChar;
  30.  
  31. procedure TAxisCustom.FormCreate(Sender: TObject);
  32. begin
  33.   inherited;
  34.   Series1.FillSampleValues(20);
  35.   Series2.FillSampleValues(20);
  36.   Series3.FillSampleValues(20);
  37. end;
  38.  
  39. procedure TAxisCustom.CheckBox1Click(Sender: TObject);
  40. var t:Integer;
  41. begin
  42.   With Chart1.CustomAxes do
  43.   for t:=0 to Count-1 do Items[t].Visible:=CheckBox1.Checked
  44. end;
  45.  
  46. procedure TAxisCustom.Button1Click(Sender: TObject);
  47. begin
  48.   if Chart1.CustomAxes.Count=0 then
  49.      EditChartAxis(Self,Chart1.LeftAxis)
  50.   else
  51.      EditChartAxis(Self,Chart1.CustomAxes[0]);
  52. end;
  53.  
  54. initialization
  55.   RegisterClass(TAxisCustom);
  56. end.
  57.