Teechartpro 7.12 Drawing a graph

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

Teechartpro 7.12 Drawing a graph

Post by Clara Genermont » Fri Aug 01, 2008 9:24 am

Hi Narcis,

Can we draw the graph of any function with
teechart directly with his equation?


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 » Fri Aug 01, 2008 9:35 am

Hi Didier,

Yes, you can use custom function. You'll find an example at All Features\Welcome!\Functions\Extended\Custom y=f(x) in the new features demo, available at TeeChart's program group.
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 » Sun Aug 03, 2008 9:37 pm

thank you Narcis,

but I can't draw a function like this

y=2+3*(1+x)-5 + (abs(-x^2) - x*x) * 2 - 1/(x + 1)
or yet
y=sinx + cosx - abs(tanx) + x


How can draw them ?

I don't understand how to intoduce this equation...

Can you show me an example ?

thank you very much for your help

Didier

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Aug 04, 2008 7:41 am

Hi Clara,

This works for me here.

Code: Select all

procedure TForm1.TeeFunction1Calculate(Sender: TCustomTeeFunction;
  const x: Double; var y: Double);
begin
  //y := 2+3*(1+x)-5 + (abs(power(-x,2)) - x*x) * 2 - 1/(x + 1);
 y := sin(x) + cos(x) - abs(tan(x)) + x;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

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

Post by Clara Genermont » Mon Aug 04, 2008 5:06 pm

sorry but
what is TeeFunction1Calculate ?
event, object or a component ?

thank you in advance

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue Aug 05, 2008 8:21 am

Hi Didier,

It's an event for TCustomTeeFunction. You should find it through Object inspector as usually if you added the function at design time (at the function object, not the series).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

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

Post by Clara Genermont » Tue Aug 05, 2008 3:13 pm

Yès, il found it and I choose Y= f(x)

but Idon't see the event ! (F11 on the Teechart)

thanks

Didier

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Aug 05, 2008 4:02 pm

Hello Didier,

When the function has been selected by editor, close the editor and F11 will take you to the object inspector. Select 'TeeFunction1' from the drop-down combobox and click on the Object Inspector's Events tab. From here you can select the event.

Regards,
Marc Meumann
Steema Support

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

Post by Clara Genermont » Wed Aug 06, 2008 9:35 am

I don't see the event
I choose "functions" and "y = f(x)"

then in the combobox I see Y= f(x) not TeeFunction1
and on F11

I don't see "OnCalculate"

????

nb:
version 7.12[/url]

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Aug 07, 2008 7:29 am

Hi Didier,

That's strange. You should see a series and a teefunction.
Another test you can do could be to add a chart (and a function) to a new form at design time and see the declarations in the code generated. For me:

Code: Select all

 //...
type
  TForm1 = class(TForm)
    Chart1: TChart;
    Series1: TLineSeries;
    TeeFunction1: TCustomTeeFunction;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
//...
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

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

Post by Clara Genermont » Thu Aug 07, 2008 12:31 pm

yès !

that's good !!! :D :D :D :D :D

I had a little concern with the installation...

THANK YOU VERY MUCH

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Fri Aug 08, 2008 7:27 am

Hi Didier,

I'm happy to see that!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

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:02 am

Hi Didier,

Please notice that I have splitted your last post into a new topic:

http://www.teechart.net/support/viewtopic.php?t=8798

It's better starting a new topic for each now issue. It's easier to follow up.
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

nitin
Newbie
Newbie
Posts: 51
Joined: Thu Aug 22, 2002 4:00 am

Post by nitin » Mon Apr 27, 2009 9:19 am

Hi Narcis,

How can I Draw this function with TeeFunction1Calculate
with three parameters :

Qf, S, Sa that can be defined by double
(exemple : Qf = 1, S = 8, Sa =4,3)

Code: Select all

y := (Qf * S * 0.36 * x) / Sa;
for this moment, I have a message "operation en virgule flottante incorrecte"

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 Apr 27, 2009 9:42 am

Hi Didier,

You can do this:

Code: Select all

procedure TForm1.TeeFunction1Calculate(Sender: TCustomTeeFunction;
  const x: Double; var y: Double);
const
  Qf = 1;
  S = 8;
  Sa = 4.3;
begin
  y := (Qf * S * 0.36 * x) / Sa;
end;
If those constants need to be modified then you can create them as global variables in your unit.

Hope this helps!
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