custom function

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Clara Genermont
Newbie
Newbie
Posts: 42
Joined: Mon Jun 11, 2007 12:00 am
Contact:

Equation

Post by Clara Genermont » Mon Nov 24, 2008 10:54 am

Hi Narcis,

I would build a program in delphi with TeeChart so that the user can enter the aquatic function and click on a display its image.

How will introduce the equation y:= f (x) in the code of the event
TForm1.TeeFunction1Calculate (Sender: TCustomTeeFunction;
CONST x: Double; VAR y: Double);

knowing it will be in the form of text there 'y:= f (x) '?

thank you for your help

Didier

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 24, 2008 11:30 am

Hi Didier,

You can use StrToFloat method for that, for example:

Code: Select all

procedure TCustomFunctionDemo.TeeFunction1Calculate(Sender: TCustomTeeFunction;
  const x: Double; var y: Double);
begin
  y:=StrToFloat('Sin(x/10)');
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Clara Genermont
Newbie
Newbie
Posts: 42
Joined: Mon Jun 11, 2007 12:00 am
Contact:

Post by Clara Genermont » Mon Nov 24, 2008 3:58 pm

Thank you Narcis !

another question :

how to revive the event "TeeFunction1Calculate"
because neither the repaint nor the invalidate work?

Didier

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 24, 2008 5:16 pm

Hi Didier,

You can try refreshing function's series datasource, for example:

Code: Select all

Series2.CheckDataSource;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply