SaveChartToFile doesn't save groups

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kai
Newbie
Newbie
Posts: 21
Joined: Mon May 10, 2004 4:00 am

SaveChartToFile doesn't save groups

Post by kai » Sat May 15, 2004 5:01 am

I noticed that saving a chart to a file does not save any groups the user creates at runtime. Is there something else you have to do to save groups along with the chart?
Thanks. 8)

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon May 17, 2004 1:23 pm

Hi.

Using TeeChart and code bellow bar series stack group are saved and correctly loaded:

Code: Select all

Uses TeeStore,
    TeeEditPRO;   //  <--- Registerrs all series classes

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.FreeAllSeries(nil);
  Chart1.AddSeries(TBarSeries);
  Chart1.AddSeries(TBarSeries);
  Chart1.AddSeries(TBarSeries);

  Chart1.Series[0].FillSampleValues(5);
  Chart1.Series[1].FillSampleValues(5);
  Chart1.Series[2].FillSampleValues(5);

  With (Chart1.Series[0] as TBarSeries) do
  begin
    MultiBar := mbStacked;
    StackGroup := 0;
  end;
  With (Chart1.Series[1] as TBarSeries) do
  begin
    MultiBar := mbStacked;
    StackGroup := 0;
  end;


  With (Chart1.Series[2] as TBarSeries) do
  begin
    MultiBar := mbStacked;
    StackGroup := 1;
  end;

end;

procedure TForm1.btnSaveClick(Sender: TObject);
begin
  SaveChartToFile(Chart1,'d:\temp\result.tee',True); // <--- Include data
  Chart1.FreeAllSeries(nil);
end;

procedure TForm1.btnLoadClick(Sender: TObject);
begin
  LoadChartFromFile(TCustomChart(Chart1),'d:\temp\result.tee');
end;
Marjan Slatinek,
http://www.steema.com

Post Reply