Page 1 of 1

Backward compatibility between 2012 and 5.03.

Posted: Wed Nov 28, 2012 2:18 am
by 16564231
Hello,

We are in the midst of upgrading TeeChart Pro from 5.03 to 2012, and have noticed some odd behaviour when loading v5.03 .tee files in the 2012 TChart component.

Certain of our charts are produced by creating data on a non DB-aware chart, before persisting the chart using SaveChartToFile. The .tee files produced by doing this can be stored on the database in a set of 'messaging' tables.

To test backward compatibility, we load .tee files produced by v5.03 (the legacy version) into the 2012 TChart component using LoadChartFromFile. This works to a certain extent, but loses all data that was persisted in the .tee file.

Out of interest, I loaded a .tee produced in v2012 into a v5.03 TChart, and it worked!?

Is there any way that .tee files produced by TeeChart 5.03 can be reliably rendered in TeeChart v2012?

Regards,

Jan

Re: Backward compatibility between 2012 and 5.03.

Posted: Wed Nov 28, 2012 9:26 am
by yeray
Hi Jan,

Could you please send us a tee file for testing purposes? Of course I mean a tee file generated with v5.03 that doesn't load the data for you with the latest version.
Right now, I'm not sure if v5 had the option to save the tee file "as text", but it would be easier to explore. Ie:

Code: Select all

SaveChartToFile(Chart1, 'C:\tmp\test.tee', true, true);
Also note we don't need a huge tee file with millions of points. You can probably reduce the size of if removing some points before exporting to the tee file.

Thanks in advance.

Re: Backward compatibility between 2012 and 5.03.

Posted: Mon Dec 03, 2012 8:48 pm
by 17563912
Sorry about the delay.

Here is a very simple pie chart file with only a few data points. This loads correctly into a v5.03 TChart but not in v9.

Apologies, but SaveChartToFile does not appear to have the overload you specified in v5.03

Re: Backward compatibility between 2012 and 5.03.

Posted: Tue Dec 04, 2012 9:25 am
by yeray
Hi,

I see. In TeeChart v8, there was a change in the LoadChartFromStreamCheck: it's last parameter, TryReadData:boolean, passed from default=true to default=false. This makes the LoadChartFromFile function not to check the Data. We'll revise it.
In the meanwhile, you can directly call LoadChartFromStreamCheck passing the TryReadData=true. This works fine for me here:

Code: Select all

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1:=TChart.Create(Self);
  Chart1.Parent:=Self;

  LoadChart(Chart1, 'C:\tmp\EmployeesChart_TC5.tee');
end;

procedure TForm1.LoadChart(AChart: TChart; AName: string);
var tmpChart: TCustomChart;
    tmp : TFileStream;
begin
  RegisterTeeStandardSeries;

  AChart.Free;
  tmpChart:=TChart.Create(Self);

  tmp:=TFileStream.Create(TeeCheckExtension(AName),fmOpenRead or fmShareDenyWrite);
  try
    LoadChartFromStreamCheck(tmpChart,tmp,nil,true);
  finally
    tmp.Free;
  end;

  AChart:=tmpChart as TChart;
  AChart.Parent:=Self;
end;