Problem with LoadChartFromFile

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Problem with LoadChartFromFile

Post by Johan Ingemansson » Thu Feb 23, 2006 2:40 pm

Hi,

I have used the following example( from your examples):

procedure TForm1.ButtonSaveClick(Sender: TObject);
begin
SaveChartToFile(Chart1,'C:\test.tee');
end;

procedure TForm1.ButtonLoadClick(Sender: TObject);
var tmpChart:TCustomChart;
begin
Chart1.Free; //assuming Chart1 is already on the Form
tmpChart:=TChart.Create(Self)
LoadChartfromFile(tmpChart,'c:\test.tee');
Chart1 := tmpChart as TChart;
Chart1.Parent:=Self;
end;

I cant get this to work, I get the follwing exception "Class TBarSeries not found". Does anyone know what might cause this problem, is there something I have forgotten?

Best regards

Johan Ingemansson

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

Post by Narcís » Thu Feb 23, 2006 3:12 pm

Hi Johan,

Just using the code below works fine. Can you please test if this works at your end?

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
    LoadChartfromFile(TCustomChart(DBChart1),OpenDialog1.FileName);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  if SaveDialog1.Execute then
      SaveChartToFile(DBChart1,SaveDialog1.FileName,DataCheckBox.Checked);
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

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Problem with LoadChartFromFile

Post by Johan Ingemansson » Thu Feb 23, 2006 6:16 pm

Hi again,

Im afraid I get the EClassNotFound (class TBarChart not found) exception, could it be something fundamental I´ve missed?

Regards,

Johan Ingemansson

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

Post by Narcís » Fri Feb 24, 2006 8:15 am

Hi Johan,

Ok, then the problem is about the units included. Before loading chart you have to register all series/tools classes you originally exported. This can be done by using RegisterTeeSeries(...) and RegisterTeeTool(...) routines. Or (much better and simpler solution) by including the TeeEditPRO unit to the import form Uses section. Including TeeEditPRO automatically registers all series/tool types.
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

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Probem Fixed!!!

Post by Johan Ingemansson » Fri Feb 24, 2006 8:32 am

Hi,

Excellent, now it works, thx :lol:

Best Regards,

Johan Ingemansson

Post Reply