TAnnotationTool : no assign function ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bertrod
Advanced
Posts: 151
Joined: Wed Sep 07, 2005 4:00 am

TAnnotationTool : no assign function ?

Post by bertrod » Mon Sep 25, 2006 3:23 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Sep 25, 2006 3:33 pm

Hi bertrod,

You can try Marjan's suggestion about cloning tools here.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

bertrod
Advanced
Posts: 151
Joined: Wed Sep 07, 2005 4:00 am

Post by bertrod » Mon Sep 25, 2006 4:22 pm

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... :roll:

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Oct 02, 2006 11:08 am

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;

Post Reply