Can't modify size of box surrounding Annotation

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Heraclitus
Newbie
Newbie
Posts: 10
Joined: Thu Jul 07, 2005 4:00 am

Can't modify size of box surrounding Annotation

Post by Heraclitus » Mon Aug 15, 2005 4:27 pm

I am using TeeChart for .NET version 2, and I would like to change (expand) the size of the box surrounding an Annotation. Is there a way to do this?

I have not seen an example of this in the help files or in the forums for the .NET TeeChart software.

Here is a C# code snippet of how I am adding the Annotation to the chart in the ASP.NET Page_Load() event:

Code: Select all

int index = chart.Tools.Add(new Annotation());
Annotation annotation = (Annotation)chart.Tools[index];

// set position
annotation.Left = chart.Axes.Left.Position + ((chart.Width / 64) * leftPos);
annotation.Top = chart.Axes.Bottom.Position + ((chart.Height / 64) * topPos);

// set text values
annotation.TextAlign = StringAlignment.Center;
annotation.Text = "Here is some text";

// set shape properties
annotation.Shape.Color = color;
annotation.Shape.CustomPosition = true;
annotation.Shape.Shadow.Visible = false;
annotation.Shape.Font.Bold = true;
When I attempt to set the annotation.Shape.Size field nothing happens. Does this need to be set in another event, or am I going down the completely wrong path?
Henry Daehnke

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Aug 17, 2005 8:22 am

Hi Heraclitus,

Well, as things stand at the moment the only way to increase the size of the annotation box is to add in some empty strings, e.g.

Code: Select all

	annotation.Text = " \n";
			annotation.Text += " Here is some text \n";
			annotation.Text += " ";
This will change with the next release of TeeChart as a new property called "CustomSize" has been added to the AnnotationTool class enabling the Width and Height properties to be set to custom values.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Heraclitus
Newbie
Newbie
Posts: 10
Joined: Thu Jul 07, 2005 4:00 am

Post by Heraclitus » Thu Aug 18, 2005 5:15 pm

Hi Christopher,

Thank you for the suggestion. I will try it.

Also, thanks for the information on the next version of TeeChart.
Henry Daehnke

Post Reply