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

  1. {$I TeeDefs.inc}
  2. unit Chart_Grid;
  3.  
  4. interface
  5.  
  6. uses
  7.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  8.   Base, Grids, TeeChartGrid, Chart, TeEngine, Series, ExtCtrls, TeeProcs,
  9.   StdCtrls, TeCanvas, TeeNavigator;
  10.  
  11. type
  12.   TChartGridForm = class(TBaseForm)
  13.     Series1: TBarSeries;
  14.     Panel2: TPanel;
  15.     ChartGridNavigator1: TChartGridNavigator;
  16.     ChartGrid1: TChartGrid;
  17.     CheckBox1: TCheckBox;
  18.     CheckBox2: TCheckBox;
  19.     ButtonColor1: TButtonColor;
  20.     procedure FormCreate(Sender: TObject);
  21.     procedure CheckBox1Click(Sender: TObject);
  22.     procedure CheckBox2Click(Sender: TObject);
  23.   private
  24.     { Private declarations }
  25.   public
  26.     { Public declarations }
  27.   end;
  28.  
  29. implementation
  30.  
  31. {$R *.DFM}
  32.  
  33. procedure TChartGridForm.FormCreate(Sender: TObject);
  34. begin
  35.   inherited;
  36.   ButtonColor1.LinkProperty(Series1,'SeriesColor');
  37.  
  38.   { fill series }
  39.   Series1.Add( 32,'John'   {$IFNDEF D4},clTeeColor{$ENDIF});
  40.   Series1.Add(417,'Anne'   {$IFNDEF D4},clTeeColor{$ENDIF});
  41.   Series1.Add( 65,'Louise' {$IFNDEF D4},clTeeColor{$ENDIF});
  42.   Series1.Add( 87,'Jeff'   {$IFNDEF D4},clTeeColor{$ENDIF});
  43.  
  44.   { after adding points, we should notify the grid... }
  45.   ChartGrid1.RecalcDimensions;
  46. end;
  47.  
  48. procedure TChartGridForm.CheckBox1Click(Sender: TObject);
  49. begin
  50.   ChartGrid1.ShowLabels:=CheckBox1.Checked;
  51. end;
  52.  
  53. procedure TChartGridForm.CheckBox2Click(Sender: TObject);
  54. begin
  55.   if CheckBox2.Checked then
  56.      ChartGrid1.Options:=ChartGrid1.Options-[goEditing]
  57.   else
  58.      ChartGrid1.Options:=ChartGrid1.Options+[goEditing];
  59.  
  60.   { repaint navigator, disabling/enabling buttons }
  61.   ChartGridNavigator1.EnableButtons;
  62. end;
  63.  
  64. initialization
  65.   RegisterClass(TChartGridForm);
  66. end.
  67.