saving and loading of entire chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
den
Newbie
Newbie
Posts: 15
Joined: Wed Jan 30, 2008 12:00 am

saving and loading of entire chart

Post by den » Tue Sep 14, 2010 12:46 pm

Is it possible to save and load, not only the chart 'template', but all information regarding the configuration of a chart? This would include what 'kind' of datasource (single record, dataset, summary, crosstab, etc.) and the name of the dataset (query1 or table1) along with the source of the apprpropriate values.

I have an application in which I wish to be able to save a configured chart, which may be, say a crosstab with data from a query, to a database. I then want the user to be able to load the chart from the database fully configured. I have tried to do this with save/loadchartfromfile, save/loadchartfrom stream, etc., but when the chart is reloaded, the user still has to configure the datasource source, whether it is a crosstab, summary, etc and the source fields for xvalues, yvalues, etc.

Thanks,

Dennis

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

Re: saving and loading of entire chart

Post by Yeray » Wed Sep 15, 2010 2:24 pm

Hi Den,

The possibility to save also the connection info in the tee file when you export your chart is a feature already in the wish list to be implemented in future releases (TV52014739).
I've incremented it's priority.
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

den
Newbie
Newbie
Posts: 15
Joined: Wed Jan 30, 2008 12:00 am

Re: saving and loading of entire chart

Post by den » Wed Sep 15, 2010 6:01 pm

Thanks, Yeray.

I would imagine in order to do this now, one would have to:

- store the tee template
- iterate through the form components to see if a dbcrosstab component existed, was assigned a series and was active --> therefore a crosstab type chart
- determine if the xvalues had "#" in them --> therefore a summary type chart
- otherwise it is most likely a simple dataset chart
- store the above, along with the connection info (including the dataset info - query sql)
- based on the stored values above, set the necessary 'properties' of the chart upon loading

To your knowledge, has this been done by anyone before, or have any hints as to how to do it now. It would be a lot easier if there were some property of the chart which would tell you what 'kind' it was, as the datasource tab of the editor does when selecting 'manual', 'random', 'single record', 'dataset', etc.

Thanks,

Dennis

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

Re: saving and loading of entire chart

Post by Narcís » Thu Sep 16, 2010 2:22 pm

Hi Dennis,

I'm not aware of anyone having done before. The only solution I can think of for now is manually assigning datasources after loading a template chart. One of the problems with this feature is that TeeChart native template files may be loaded in machines different to the one which generated them and required datasources may not exist there. However, you can already choose whether you want to include series data when exporting a chart. There are programmatic datasource setting examples in the database related tutorial. Tutorials can be found 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

Post Reply