home *** CD-ROM | disk | FTP | other *** search
- unit uteescro;
-
- interface
-
- { This example shows the TChartScrollBar component.
-
- You should first install this component in Delphi's
- component library:
-
- Select the TeeScrob.pas unit to install TChartScrollBar.
- }
- uses
- Wintypes, WinProcs, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- teescrob, ExtCtrls, TeeProcs, TeEngine, Chart, StdCtrls, Buttons, Series;
-
- type
- TScrollBarForm = class(TForm)
- Chart1: TChart;
- ChartScrollBar1: TChartScrollBar;
- ChartScrollBar2: TChartScrollBar;
- RadioGroup1: TRadioGroup;
- RadioGroup2: TRadioGroup;
- Button1: TButton;
- Series1: TLineSeries;
- Series2: TLineSeries;
- Memo1: TMemo;
- Button2: TButton;
- VerticalInvert: TCheckBox;
- HorizontalInvert: TCheckBox;
- procedure FormCreate(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure RadioGroup1Click(Sender: TObject);
- procedure RadioGroup2Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure VerticalInvertClick(Sender: TObject);
- procedure HorizontalInvertClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- ScrollBarForm: TScrollBarForm;
-
- implementation
-
- {$R *.DFM}
-
- procedure TScrollBarForm.FormCreate(Sender: TObject);
- begin { sample values }
- Series1.FillSampleValues(100);
- Series2.FillSampleValues(100);
- end;
-
- procedure TScrollBarForm.Button1Click(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TScrollBarForm.RadioGroup1Click(Sender: TObject);
- begin
- { set the desired Horizontal axis to scroll (Top or Bottom) }
- { ChartScrollBar1 is the Horizontal scroll bar }
- Case RadioGroup1.ItemIndex of
- 0: ChartScrollBar1.Axis:=sbDefault;
- 1: ChartScrollBar1.Axis:=sbOther;
- 2: ChartScrollBar1.Axis:=sbBoth;
- end;
- end;
-
- procedure TScrollBarForm.RadioGroup2Click(Sender: TObject);
- begin
- { set the desired Vertical axis to scroll (Left or Right) }
- { ChartScrollBar2 is the Vertical scroll bar }
- Case RadioGroup2.ItemIndex of
- 0: ChartScrollBar2.Axis:=sbDefault;
- 1: ChartScrollBar2.Axis:=sbOther;
- 2: ChartScrollBar2.Axis:=sbBoth;
- end;
- end;
-
- procedure TScrollBarForm.Button2Click(Sender: TObject);
- begin
- Chart1.UndoZoom; { reset scroll and zoom }
- end;
-
- procedure TScrollBarForm.VerticalInvertClick(Sender: TObject);
- begin
- ChartScrollBar2.Inverted:=VerticalInvert.Checked;
- end;
-
- procedure TScrollBarForm.HorizontalInvertClick(Sender: TObject);
- begin
- ChartScrollBar1.Inverted:=HorizontalInvert.Checked;
- end;
-
- end.
-