Hello Roumen,
roumen wrote:It is disappointing that the problem was reported in 2013 and in 2018 CloneChart is not doing what it is supposed to do still...
You are right. I've revised the ticket
#780 and just implemented a fix for it.
Since you own the TeeChart sources - and it's pretty simple - you can implement it and (Tee)Recompile them.
At CloneChart method in Chart.pas, add this after the loop where the series are cloned:
Code: Select all
procedure CloneChart(const Dest,Origin:TCustomChart; const AOwner:TComponent; ForceManualData:Boolean);
//...
for t:=0 to Origin.SeriesCount-1 do
begin
//...
CloneChartSeries(Origin[t],AOwner,Dest);
//...
end;
// Relink Custom Axes within Destination Series
for t:=0 to Origin.SeriesCount-1 do
begin
if Origin[t].CustomVertAxis <> nil then
Dest[t].CustomVertAxis:=Dest.CustomAxes[Origin[t].CustomVertAxis.Index];
if Origin[t].CustomHorizAxis <> nil then
Dest[t].CustomHorizAxis:=Dest.CustomAxes[Origin[t].CustomHorizAxis.Index];
end;
//...
At the end of the TChartAxis.Assign method in TeEngine.pas, add this:
Code: Select all
procedure TChartAxis.Assign(Source: TPersistent);
Begin
if Source is TChartAxis then
With TChartAxis(Source) do
Begin
//...
Self.FPartnerAxis :=FPartnerAxis;
Self.FUsePartnerAxis :=FUsePartnerAxis;
end
else inherited;
end;