I am having the same problem with the question yesterday. Saving works fine, but trying to load causes one of the above mentioned exceptions.
I have two events (OnZoom and UndoZoom) used. What do you mean with disconnect (OnZoom := Nil ?) and what do you mean with reconnect? I am a little confused: Why has TChart loading-problems with events it can not save?
I will repeat my yesterdays question: can i load a template
onto a existing chart (with several types of different series, chosen by the user at runtime), without loosing the seriesinformation (i am just asking, because i did not manage a reload again until now
)
Another thing: i have seen in the exported file is a definition of a visible series. This series can be another type when loaded, because i just need the properties of the axes/walls ... and related. Any workaround for this? We are having a presentation next week and it would be great if this works! Maybe just a minor feature among the calculation routines, but an exciting...
Thanks and hoping for help
Jan
This is the code so far:
procedure TfrmGraphic.btSaveTemplateClick(Sender: TObject);
Var tempZoomProc : Pointer;
tempUndoZoomProc : Pointer;
begin
With SaveChartTemplateDialog do
Begin
Filter:='Teefiles|*.tee';
if Execute then SaveChartToFile (Chart1, FileName, False, True);
end;
end;
procedure TfrmGraphic.btLoadTemplateClick(Sender: TObject);
Var tmpChart : TCustomChart;
begin
// Chart1.Free; //assuming Chart1 is already on the Form
tmpChart := TChart.Create (Self);
With LoadChartTemplateDialog do
Begin
Filter := 'Teefiles|*.tee';
if Execute then LoadChartfromFile (tmpChart, FileName);
end;
Chart1 := tmpChart as TChart;
With Chart1 do
Begin
Parent := Self;
end;
// FreeAndNil (tmpChart);
end;