Page 1 of 1

Can't modify size of box surrounding Annotation

Posted: Mon Aug 15, 2005 4:27 pm
by 9637652
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?

Posted: Wed Aug 17, 2005 8:22 am
by Chris
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.

Posted: Thu Aug 18, 2005 5:15 pm
by 9637652
Hi Christopher,

Thank you for the suggestion. I will try it.

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