.


:




:

































 

 

 

 


TChart




 

TChart . EditingChart (. .8.2). Series1 Add Siries. TeeChartGalleri Line ( ). , 3D. Seriesl. Title.

"sin(x)". Series2 cos(x).

Titles : ".

Axis . , EditingChart.

 

 

. Chart1.BottomAxis Automatic False, .

 

 

Tform1.Button1Click " ". Tform1.Bttnon2CIick " ". (X, Y) Seriesk Series1.AddXY(Const AXValue, AYValue: Double; Const AXLabel: String; Acolor: TColor): Longint;, AXValue, AYValue - X Y; AXLabel ; Acolor ( clTeeColor, , ).

:

Unit Unit1;

Interface

Uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls, TeeProcs, TeEngine, Chart, Series;

 

type

TForm1 = class(TForm)

Chart1: TChart;

Button1: TButton;

Button2: TButton;

Edit1: TEdit;

Edit2: TEdit;

Edit3: TEdit;

Edit4: TEdit;

Edit5: TEdit;

Edit6: TEdit;

Edit7: TEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

Series1: TLineSeries;

Series2: TLineSeries;

procedure FormCreate(Sender: TObject);

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form1: TForm1;

Xmin, Xmax, Ymin, Ymax, Hx, Hy, h: extended;

 

Implementation

{$R *.DFM}

 

Procedure TForm1.FormCreate(Sender: TObject);

begin

Xmin:= 0;

Xmax:= 2 * Pi;

Ymin:= -1;

Ymax:= 1;

Hx:= pi/2;

Hy:= 0.5;

h:= 0.01;

 

Edit1.Text:= FloatToStr(Xmin);

Edit2.Text:= FloatToStr(Xmax);

Edit3.Text:= FloatToStr(Ymin);

Edit4.Text:= FloatToStr(Ymin);

Edit5.Text:= FloatToStr(Hx);

Edit6.Text:= FloatToStr(Hy);

Edit7.Text:= FloatToStr(h);

 

Chart1.BottomAxis.Automatic:= False;

Chart1.BottomAxis.Minimum:= Xmin;

Chart1.BottomAxis.Maximum:= Xmax;

 

Chart1.LeftAxis.Automatic:= False;

Chart1.LeftAxis.Minimum:= Ymin;

Chart1.LeftAxis.Maximum:= Ymax;

 

Chart1.BottomAxis.Increment:= Hx;

Chart1.LeftAxis.Increment:= Hy;

end;

 

Procedure TForm1.Button1Click(Sender: TObject);

var

x, y1, y2: extended;

begin

Series1.Clear;

Series2.Clear;

Xmin:= StrToFloat(Edit1.Text);

Xmax:= StrToFloat(Edit2.Text);

h:= StrToFloat(Edit7.Text);

x:= Xmin;

Repeat

y1:= sin(x);

Series1.AddXY(x, y1, '', clTeeColor);

y2:= cos(x);

Series2.AddXY(x, y2, '', clTeeColor);

x:= x + h;

Until (x > Xmax);

end;

 

Procedure TForm1.Button2Click(Sender: TObject);

begin

Halt //Exit

end;

end.





:


: 2016-07-29; !; : 580 |


:

:

, .
==> ...

1708 - | 1519 -


© 2015-2024 lektsii.org - -

: 0.009 .