How to negate a serie

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Achim
Newbie
Newbie
Posts: 10
Joined: Tue Nov 27, 2007 12:00 am

How to negate a serie

Post by Achim » Wed Nov 05, 2008 8:36 am

I'm using the Standard Deviation function within the design-mode.
Now I'm looking for a negate function, to create a new serie with the
negated data of the StdDev-Serie.

Maybe the subtract-function with a const like

StdDevMinSerie := 0 - StdDdv

What can I do

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

Post by Narcís » Wed Nov 05, 2008 9:49 am

Hi Achim,

You can do something like this:

Code: Select all

  Series2.Clear;
  for i:=0 to Series1.Count-1 do
  begin
    Series2.AddXY(Series1.XValue[i], -Series1.YValue[i]);
  end;
You can also use custom function as shown in the example at All Features\Welcome!\Functions\Extended\Custom y=f(x) at the new features demo, available at TeeChart's program group.

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

Achim
Newbie
Newbie
Posts: 10
Joined: Tue Nov 27, 2007 12:00 am

Post by Achim » Wed Nov 05, 2008 11:51 am


You can do something like this:

Code: Select all

  Series2.Clear;
  for i:=0 to Series1.Count-1 do
  begin
    Series2.AddXY(Series1.XValue[i], -Series1.YValue[i]);
  end;
But where is the best place(event) for this code. After showing a form I set query.active to true, and then the chart is shown.
You can also use custom function as shown in the example at All Features\Welcome!\Functions\Extended\Custom y=f(x) at the new features demo, available at TeeChart's program group.
Hm.. I' cannot set the OnCalculate property, because I don't find it, neither in the chart nor at the series. In short: I need a tutorial how to find the OnCalculate property at the Objectinspector. :-)
[/quote]

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

Post by Narcís » Wed Nov 05, 2008 12:11 pm

Hi Achim,
But where is the best place(event) for this code. After showing a form I set query.active to true, and then the chart is shown.
You can use this code after activating the query or even in Series1 OnAfterAdd event.
Hm.. I' cannot set the OnCalculate property, because I don't find it, neither in the chart nor at the series. In short: I need a tutorial how to find the OnCalculate property at the Objectinspector.
You need to select function, for example TeeFunction1 and go to its events tab in the object inspector.
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

Achim
Newbie
Newbie
Posts: 10
Joined: Tue Nov 27, 2007 12:00 am

Post by Achim » Wed Nov 05, 2008 1:34 pm

You can use this code after activating the query
Thanks, that works.
You need to select function, ....
I don't find it.

I drop a dbchart to a form, double-click on it -> Add.. -> functions -> y=f(x) . I get the serie1 in the serieslist.
After selecting the dbchart on the form, I saw the chart-properties in the objectinspector, but there is no property with name 'functions'. There is also the property 'SeriesList'. After selecting it, I can choose a serie and see its series-properties, even without 'functions'. Maybe I'm to stupit, but I cannot find it.

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

Post by Narcís » Wed Nov 05, 2008 1:41 pm

Hi Achim,

No, you need to select TeeFunction1 object in the Object Inspector instead of DBChart1.
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

Achim
Newbie
Newbie
Posts: 10
Joined: Tue Nov 27, 2007 12:00 am

Post by Achim » Wed Nov 05, 2008 2:31 pm

No, you need to select TeeFunction1 object in the Object Inspector
Wow, I've found it. It's the first time I've select a component in this way, after several 'delphi-years'. I've always select an icon or component on the form to access the properties. :oops:

Post Reply