Page 1 of 1
Scripting/calculation options during runtime
Posted: Fri May 28, 2010 1:28 pm
by 9235161
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
Re: Scripting/calculation options during runtime
Posted: Fri May 28, 2010 2:40 pm
by yeray
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.
Re: Scripting/calculation options during runtime
Posted: Sat May 29, 2010 12:32 pm
by 9235161
Hi,
thanks for your answer.
In the meantime I've searched around and found a very excellent solution.
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
Re: Scripting/calculation options during runtime
Posted: Mon May 31, 2010 9:21 am
by yeray
Hi UFriedrich,
Thanks for sharing! It will help for sure other customers with similar problems.