home *** CD-ROM | disk | FTP | other *** search
- {****************************************}
- { TeeChart. TChart Component }
- { Copyright (c) 1995-98 by David Berneda }
- { All Rights Reserved }
- {****************************************}
- unit UMulab;
-
- interface
-
- uses
- WinProcs,WinTypes, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- TeEngine, Series, TeeProcs, Chart, StdCtrls, ExtCtrls;
-
- type
- TMultiLineLabelsForm = class(TForm)
- Panel1: TPanel;
- Memo1: TMemo;
- Button1: TButton;
- CheckBox1: TCheckBox;
- Chart1: TChart;
- Series1: TBarSeries;
- Label1: TLabel;
- ComboBox1: TComboBox;
- procedure Button1Click(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure CheckBox1Click(Sender: TObject);
- procedure ComboBox1Change(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- Procedure FillBars;
- end;
-
- implementation
-
- {$R *.DFM}
-
- procedure TMultiLineLabelsForm.Button1Click(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TMultiLineLabelsForm.FormShow(Sender: TObject);
- begin
- { leave space for labels... }
- Chart1.MarginBottom:=15;
- ComboBox1.ItemIndex:=0;
- FillBars;
- end;
-
- procedure TMultiLineLabelsForm.CheckBox1Click(Sender: TObject);
- begin
- FillBars;
- end;
-
- Procedure TMultiLineLabelsForm.FillBars;
- var tmp:String;
- begin
- if CheckBox1.Checked then tmp:=TeeLineSeparator
- else tmp:=' ';
-
- { add Bars with labels... }
- Series1.Clear;
- Series1.Add( 1234, 'John'+tmp+'Smith', clTeeColor );
- Series1.Add( 2212, 'Andy'+tmp+'Jones', clTeeColor );
- Series1.Add( 3214, 'Peter'+tmp+'Green'+tmp+'Jr.', clTeeColor );
- end;
-
- procedure TMultiLineLabelsForm.ComboBox1Change(Sender: TObject);
- begin
- Case ComboBox1.ItemIndex of
- 0: Chart1.BottomAxis.LabelsAngle:=0;
- 1: Chart1.BottomAxis.LabelsAngle:=90;
- 2: Chart1.BottomAxis.LabelsAngle:=180;
- else
- {3: } Chart1.BottomAxis.LabelsAngle:=270;
- end;
- if (ComboBox1.ItemIndex=1) or (ComboBox1.ItemIndex=3) then
- Chart1.MarginBottom:=5
- else
- Chart1.MarginBottom:=15;
- end;
-
- end.
-