Установлен Lazarus 0.9.26b + Win Xp
Работает ли тут вообще Tchart? как добавить серии( нужны line и bar)? 
на форме компонет Tchart, выделяю его, клик правой кнопки мыши, но в меню нет пункта редактирования chart'a как в Delphi
			
		Модератор: Модераторы
unit Unit3; 
{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  TAGraph, StdCtrls,TASeries,math;
type
  { TForm3 }
  TForm3 = class(TForm)
    Button1: TButton;
    Chart1: TChart;
    Edit1: TEdit;
    Edit2: TEdit;
   procedure Button1Click(Sender: TObject);
   private
   s: TSerie;
    qw: TSerie;
  public
    { public declarations }
  end; 
var
  Form3: TForm3; 
  IntPr,IntS,MNL: real;
  b,a: real;
implementation
 //uses Unit1, Unit2;
{ TForm3 }
procedure pramoug (a,b: real; n: integer; var s:real);
var
h,f,x: real; i: integer;
begin
h:=(b-a)/n;
x:=a+h;
S:=0;
for i:=0 to n-1 do
 begin
 F:=3+5*exp(sin(-x))*cos(x);
 s:=s+f;
 x:=x+h;
 end;
s:=s*h;
end;
procedure Simpson (a,b: real; n: integer; var s2:real);
var
h,c,f,x: real; i: integer;
begin
if (n mod 2)=1 then n:=n-1;
h:=(b-a)/n;
s2:=0;
c:=1;
x:=a;
 For i:=1 to n-1 do
 begin
 x:=x+h;
 f:=3+5*exp(sin(-x))*cos(x);
 s2:=S2+(3+c)*f;
 c:=-c;
 end;
s2:=h*(3+5*exp(sin(-a))*cos(a)+3+5*exp(sin(-b))*cos(b)+s2)/3;
end;
procedure TForm3.Button1Click(Sender: TObject);
var x:real;
begin
 a:=strtofloat(edit1.text);
  b:=strtofloat(edit2.text);
Chart1.BottomAxis.Visible :=true;
 Chart1.LeftAxis.Visible :=true;
 qw:= TSerie.Create(Chart1);
     qw.ShowLines := true;
     qw.ShowPoints := false;
    qw.Pointer.Style := psRectangle;
 chart1.Visible:=true;
 MNL:=3*b-5*exp(-sin(b))-(3*a-5*exp(-sin(a)));
 qw.Clear; {Построение графика для метода прямоугольников}
   x:=10;
   while x<=200 do
   begin
     pramoug(a,b,ceil(x),IntPr);
     qw.AddXY(x,abs(MNL-IntPr),'',clred);
     x:=x+10;
   end;
s:= TSerie.Create(Chart1);
     s.ShowLines := true;
s.Clear; {Построение графика для метода Симпсона}
   x:=10;
   while x<=200 do
   begin
     Simpson(a,b,ceil(x),IntS);
     s.AddXY(x,abs(MNL-IntS),'',clgreen);
     x:=x+10;
   end; 
end;
initialization
  {$I unit3.lrs}
end.                      Установлен Lazarus 0.9.26b + Win Xp
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1