Scripting/calculation options during runtime

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
UFriedrich
Newbie
Newbie
Posts: 9
Joined: Fri Dec 03, 2004 5:00 am
Location: Germany

Scripting/calculation options during runtime

Post by UFriedrich » Fri May 28, 2010 1:28 pm

Hi,

is it possible to add calculation formulas during runtime. For example when a chart has 1 series to calculate with the values of this series and add the results to a second series. The second series will be created on runtime if required.

The calculation formula must be defined in a memo during runtime f.e. so that a user can calculate all things he need.
What is the best way to have such a functionality?

Thanks

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

Re: Scripting/calculation options during runtime

Post by Yeray » Fri May 28, 2010 2:40 pm

Hi UFriedrich,

I think you should use Custom function to represent the desired formula. Please take a look at the demo at All features\Welcome !\Functions\Extended\Custom y=f(x).
The problem will be when parsing your string from the memo to the function. This has already been discussed here.
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

UFriedrich
Newbie
Newbie
Posts: 9
Joined: Fri Dec 03, 2004 5:00 am
Location: Germany

Re: Scripting/calculation options during runtime

Post by UFriedrich » Sat May 29, 2010 12:32 pm

Hi,

thanks for your answer.

In the meantime I've searched around and found a very excellent solution. :mrgreen:

I'll use Python to make all things I need (business logic) and present them in a Delphi application an a chart component. Delphi as Host with the GUI and Python for all the calculations. Here is a complete example to do such things:
http://www.atug.com/andypatterns/Python ... ample1.htm

I've tested it in a small project and with this method I can use on Python side the ChartSeries object and can return calculated values to add them to another series. In the Python script I have the full power of a programming language with all the libraries and mudules are available around the world. Furthermore are components available I need for build a Python IDE with code highlighting, code completion, code checking and execution.

With all the things it's possible to extend a chart with powerfull custom functions.

Regards

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

Re: Scripting/calculation options during runtime

Post by Yeray » Mon May 31, 2010 9:21 am

Hi UFriedrich,

Thanks for sharing! It will help for sure other customers with similar problems.
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

Post Reply