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

  1. {*********************************************}
  2. {  TeeChart Pro 4 example                     }
  3. {  Copyright (c) 1995-1998 by David Berneda   }
  4. {  All rights reserved                        }
  5. {*********************************************}
  6. unit uticklab;
  7.  
  8. interface
  9.  
  10. { This example shows how to use the Axis
  11.   TickOnLabelsOnly property.
  12.  
  13.   This property is used to control if axis grid lines and ticks
  14.   are displayed at label positions or at all Axis Increment
  15.   positions.
  16.  
  17.   Explanation:
  18.   By default, the Axis avoids label overlapping. This is
  19.   controlled with the Axis LabelsSeparation property.
  20.   When the Axis skip labels that would overlap, it also
  21.   skips drawing grid lines and ticks, unless
  22.   TickOnLabelsOnly property is False.
  23.  
  24. }
  25. uses
  26.   WinTypes, WinProcs, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  27.   TeEngine, Series, ExtCtrls, TeeProcs, Chart, StdCtrls, Buttons;
  28.  
  29. type
  30.   TFormTicksLabels = class(TForm)
  31.     Chart1: TChart;
  32.     Series1: TFastLineSeries;
  33.     CheckBox1: TCheckBox;
  34.     Button1: TButton;
  35.     Label1: TLabel;
  36.     procedure FormCreate(Sender: TObject);
  37.     procedure Button1Click(Sender: TObject);
  38.     procedure CheckBox1Click(Sender: TObject);
  39.   private
  40.     { Private declarations }
  41.   public
  42.     { Public declarations }
  43.   end;
  44.  
  45. implementation
  46.  
  47. {$R *.DFM}
  48.  
  49. procedure TFormTicksLabels.FormCreate(Sender: TObject);
  50. var t:Longint;
  51. begin
  52.   for t:=1 to 50 do Series1.Add(Random(100),IntToStr(t),clTeeColor);
  53. end;
  54.  
  55. procedure TFormTicksLabels.Button1Click(Sender: TObject);
  56. begin
  57.   Close;
  58. end;
  59.  
  60. procedure TFormTicksLabels.CheckBox1Click(Sender: TObject);
  61. begin
  62.   Chart1.BottomAxis.TickOnLabelsOnly:=CheckBox1.Checked;
  63. end;
  64.  
  65. end.
  66.