home *** CD-ROM | disk | FTP | other *** search
- {$I TeeDefs.inc}
- unit Chart_Grid;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Base, Grids, TeeChartGrid, Chart, TeEngine, Series, ExtCtrls, TeeProcs,
- StdCtrls, TeCanvas, TeeNavigator;
-
- type
- TChartGridForm = class(TBaseForm)
- Series1: TBarSeries;
- Panel2: TPanel;
- ChartGridNavigator1: TChartGridNavigator;
- ChartGrid1: TChartGrid;
- CheckBox1: TCheckBox;
- CheckBox2: TCheckBox;
- ButtonColor1: TButtonColor;
- procedure FormCreate(Sender: TObject);
- procedure CheckBox1Click(Sender: TObject);
- procedure CheckBox2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- implementation
-
- {$R *.DFM}
-
- procedure TChartGridForm.FormCreate(Sender: TObject);
- begin
- inherited;
- ButtonColor1.LinkProperty(Series1,'SeriesColor');
-
- { fill series }
- Series1.Add( 32,'John' {$IFNDEF D4},clTeeColor{$ENDIF});
- Series1.Add(417,'Anne' {$IFNDEF D4},clTeeColor{$ENDIF});
- Series1.Add( 65,'Louise' {$IFNDEF D4},clTeeColor{$ENDIF});
- Series1.Add( 87,'Jeff' {$IFNDEF D4},clTeeColor{$ENDIF});
-
- { after adding points, we should notify the grid... }
- ChartGrid1.RecalcDimensions;
- end;
-
- procedure TChartGridForm.CheckBox1Click(Sender: TObject);
- begin
- ChartGrid1.ShowLabels:=CheckBox1.Checked;
- end;
-
- procedure TChartGridForm.CheckBox2Click(Sender: TObject);
- begin
- if CheckBox2.Checked then
- ChartGrid1.Options:=ChartGrid1.Options-[goEditing]
- else
- ChartGrid1.Options:=ChartGrid1.Options+[goEditing];
-
- { repaint navigator, disabling/enabling buttons }
- ChartGridNavigator1.EnableButtons;
- end;
-
- initialization
- RegisterClass(TChartGridForm);
- end.
-