LoadChartFromFile/SaveChartToFile help needed!

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Sharpenski
Newbie
Newbie
Posts: 36
Joined: Wed Aug 24, 2016 12:00 am

LoadChartFromFile/SaveChartToFile help needed!

Post by Sharpenski » Tue Aug 30, 2016 12:03 pm

Hi,

I am desperately seeking a way to both save and load chart settings without data as well as with. I understand that SaveChartToFile can be paramaterised so that only the chart settings are exported - and not the data - which is ideal. However, when loading the settings back in I find that the chart no longer works with my code, flagging invliad references to the TLineSeries object that was there previously. If I reference the TChartSeries - e.g. Chart1.Series[0] - then it works but my code is deisgned to interact with the TLineSeries object (Series1) and I would ideally not like to change this. Is there something I an do to get round this issue?

Yeray
Site Admin
Site Admin
Posts: 9533
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: LoadChartFromFile/SaveChartToFile help needed!

Post by Yeray » Wed Aug 31, 2016 7:37 am

Hello,

The variables aren't stored in the object so the chart can't recreate them when loading the tee file.
However, you can reassign them if you want. Ie with a TPieSeries:

Code: Select all

uses Chart, Series, TeeConst, TeeStore;

procedure TForm1.FormCreate(Sender: TObject);
var Chart1: TChart;
    Series1: TPieSeries;
begin
  Chart1:=TChart.Create(Self);
  LoadChartFromFile(Chart1, 'C:\tmp\pie.tee');
  Chart1.Parent:=Self;

  Series1:=Chart1[0] as TPieSeries;
  Series1.Circled:=false;
end;

initialization

RegisterTeeSeries(TPieSeries, @TeeMsg_GalleryPie, @TeeMsg_GalleryStandard, 1);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply