Page 1 of 1

Problem with LoadChartFromFile

Posted: Thu Feb 23, 2006 2:40 pm
by 9232649
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

Posted: Thu Feb 23, 2006 3:12 pm
by narcis
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;

Problem with LoadChartFromFile

Posted: Thu Feb 23, 2006 6:16 pm
by 9232649
Hi again,

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

Regards,

Johan Ingemansson

Posted: Fri Feb 24, 2006 8:15 am
by narcis
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.

Probem Fixed!!!

Posted: Fri Feb 24, 2006 8:32 am
by 9232649
Hi,

Excellent, now it works, thx :lol:

Best Regards,

Johan Ingemansson