home *** CD-ROM | disk | FTP | other *** search
- {**********************************************}
- { TErrorBarSeries Component Example }
- { Copyright (c) 1995-1998 by David Berneda }
- {**********************************************}
- {$P-} { <-- this is very, very important }
- unit Uerrorba;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, Teengine, Series, Errorbar, ExtCtrls, Chart, StdCtrls,
- Buttons, TeeProcs;
-
- type
- TErrorBarForm = class(TForm)
- Chart1: TChart;
- ErrorBarSeries1: TErrorBarSeries;
- Panel1: TPanel;
- CheckBox1: TCheckBox;
- Label1: TLabel;
- BitBtn3: TBitBtn;
- Memo1: TMemo;
- procedure FormCreate(Sender: TObject);
- procedure CheckBox1Click(Sender: TObject);
- procedure Chart1GetLegendText(Sender: TCustomAxisPanel;
- LegendStyle: TLegendStyle; Index: Longint;
- var LegendText: String);
- procedure Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
- Y: Integer);
- procedure BitBtn3Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- implementation
-
- {$R *.DFM}
- procedure TErrorBarForm.FormCreate(Sender: TObject);
- begin
- ErrorBarSeries1.FillSampleValues(18);
- Label1.Caption:='';
- end;
-
- procedure TErrorBarForm.CheckBox1Click(Sender: TObject);
- begin
- Chart1.View3D:=CheckBox1.Checked;
- end;
-
- procedure TErrorBarForm.Chart1GetLegendText(Sender: TCustomAxisPanel;
- LegendStyle: TLegendStyle; Index: Longint; var LegendText: String);
- begin
- if LegendStyle=lsValues then
- LegendText:=LegendText+' '+
- FormatFloat('0.00',ErrorBarSeries1.ErrorValue[Index]);
- end;
-
- procedure TErrorBarForm.Chart1MouseMove(Sender: TObject;
- Shift: TShiftState; X, Y: Integer);
- var tmp:Longint;
- begin
- tmp:=ErrorBarSeries1.Clicked(x,y);
- if tmp<>-1 then
- Label1.Caption:='Error Bar: '+FormatFloat('0.00',ErrorBarSeries1.ErrorValue[tmp])
- else
- Label1.Caption:='';
- end;
-
- procedure TErrorBarForm.BitBtn3Click(Sender: TObject);
- begin
- Close;
- end;
-
- end.
-