Saving Chart Specification 5.02/Delphi 6

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
tcardinal
Newbie
Newbie
Posts: 3
Joined: Mon Nov 04, 2002 5:00 am

Saving Chart Specification 5.02/Delphi 6

Post by tcardinal » Tue Mar 14, 2006 1:44 pm

Is there a way to save the specification of a chart (Datasource, series, Titles etc) rather than the whole chart?

many thanks

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

Post by Narcís » Tue Mar 14, 2006 2:40 pm

Hi tcardinal,

First of all, please notice that TeeChart native files (.tee) don't save series datasources. Having that in mind, you may export series styles (line, bar, points, etc.), data and titles using XML exporting.

Also notice that .tee files only store those settings which have been changed in a default chart so no much data is stored on them.
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

tcardinal
Newbie
Newbie
Posts: 3
Joined: Mon Nov 04, 2002 5:00 am

Post by tcardinal » Wed Mar 15, 2006 1:25 pm

Many thanks Narcís

I have found the SaveToStream and LoadFromStream in the TeeStore unit.

However, I need to save these to an XML document but the .tee format contains characters not allowed in XML. As a result I get an error when I try to write to my XML document.

Is there another format I can save to? If so where would I find the function?

many thanks

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 Mar 15, 2006 2:02 pm

Hi tcardinal,

To store a TeeChart into a XML file you need to do something like this:

Code: Select all

Procedure TExportXMLForm.ShowSavedFile;
begin
  GoToURL(Handle,SaveDialog1.FileName);
end;

procedure TExportXMLForm.Button1Click(Sender: TObject);
begin
  if SaveDialog1.Execute then
  begin
   { nil = all series in Chart1 }
    with TSeriesDataXML.Create(Chart1,nil) do
    try
      IncludeIndex:=CheckBox1.Checked;

      SaveToFile(SaveDialog1.FileName);
      ShowSavedFile;
    finally
      Free;
    end;
  end;
end;
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