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.
SaveChartToFile doesn't save groups
Hi.
Using TeeChart and code bellow bar series stack group are saved and correctly loaded:
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
http://www.steema.com