Page 1 of 1
TAnnotationTool : no assign function ?
Posted: Mon Sep 25, 2006 3:23 pm
by 9343260
Hey,
I'm assigning manually some parts of the chart (axis, legend, annotation), but I noticed there is no TAnnotationTool.Assign() function. Is there another way to copy an annotation look ?
Tx
Posted: Mon Sep 25, 2006 3:33 pm
by narcis
Hi bertrod,
You can try Marjan's suggestion about cloning tools
here.
Posted: Mon Sep 25, 2006 4:22 pm
by 9343260
narcis wrote:Hi bertrod,
You can try Marjan's suggestion about cloning tools
here.
I had seen this post during my research on the forum, but Marjan is using the "Assign" function to clone the tools, and as I said, the TAnnotationTool.Assign method is not implemented and I was wondering why...
Posted: Mon Oct 02, 2006 11:08 am
by Pep
Hi,
for the moment there's no way to copy all the properties automatically, however it's on our wish list to be considered for further releases.
In meantime a workaround is to set them manually, ie :
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
begin
Chart2.Tools.Clear;
Chart2.Assign(Chart1);
for i:=0 to Chart1.Tools.Count-1 do
begin
CloneChartTool(Chart1.Tools[i],Chart2).ParentChart:=Chart2;
if (Chart1.Tools[i] is TAnnotationTool) then
(Chart2.Tools.Items[i] as TAnnotationTool).Position := (chart1.tools[i] as TAnnotationTool).position;
end;
end;