TeeChart Example?
Hi,
I have filled a db table with some demo data:
<!--fonto:Lucida Console--><span style="font-family:Lucida Console"><!--/fonto-->CARS PHONES MONITORS LAMPS
44 852 834 973
843 962 600 351
958 650 998 541
<!--fontc--></span><!--/fontc-->
Now I would like to get a chart in FastReport with those 3 series.
I don't get it, folks... how can I do this using the TfrxChart wrapper?
I would like to do a "radar series" and I am using TeeChart PRO 8, but this
is probably unimportant..
Do I need to add series by script?
Any hint is very welcome, thanks a lot
Daniel
I have filled a db table with some demo data:
<!--fonto:Lucida Console--><span style="font-family:Lucida Console"><!--/fonto-->CARS PHONES MONITORS LAMPS
44 852 834 973
843 962 600 351
958 650 998 541
<!--fontc--></span><!--/fontc-->
Now I would like to get a chart in FastReport with those 3 series.
I don't get it, folks... how can I do this using the TfrxChart wrapper?
I would like to do a "radar series" and I am using TeeChart PRO 8, but this
is probably unimportant..
Do I need to add series by script?
Any hint is very welcome, thanks a lot
Daniel
Comments
* FastReport expects one db-rowset per teechart-series
* for radar series FastReport expects a "LABEL / ANGLE / VALUE" rowformat
Consequences:
* I need one query per series
* if I want to use radar series, I need to change the sql from
to
... which is of course very bad SQL-coding (too complicated, too many queries).
How can I simplify this? Read the data from the simple "SELECT *" query and add the series-data
by script?
Please help!
Daniel
then in the onbeforeprintmethod of the chart object.
use the add method to add values to each series.
tip you can connect the query to a hiddendataband set to 1 record
then in the obpevent of the chart object write code to iterate through the dataset and add the values to the series'.
begin
masterdata1.dataset.first;
for i = 0 to masterdata1.dataset.recordcount-1 do
begin
code to add values to series[0];
code to add values to series[1];
code to add values to series[2];
masterdata1.dataset.next;
next;
end;
see the usermanual on working with charts.
works fine, here's my scripting code (in case somebody's interested... :-) ):
Cheers, Daniel