after I get the information from Pep that the templates are not designed for changing the appearance of a chart I started writing my own code. But I wont get it working to copy a chart from one chart to another.
What I wanna do is the following:
I want to load a chart template to a temporary chart which is created by code. Then I copy the data from my original chart to the temp chart. After that I want to overwrite the original chart to the temp chart.
I hope this is the correct way. I read here in the forum that I have to manually assign the series to the data. But I have no idea how to do this.
This is the code I used to create a Chart, load a template to it and copy the data:
Code: Select all
procedure TForm12.dxBarButton3Click(Sender: TObject);
var
tmpChart : TChart;
I : Word;
begin
tmpChart := TChart.Create(Self);
tmpChart.Parent := Self;
LoadChartfromFile(TCustomChart(tmpChart), 'Template.tee'); //OpenDialog1.FileName);
for I := 0 to Chart1.SeriesCount - 1 do begin
tmpChart[I].AssignValues(Chart1[I]);
end;
Could you please give me a simple example how I can realize this? If it is helpfull I can give you a sample application with my code I have written until now.