How to adjust annotation position after zoom/resize??

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
fano
Newbie
Newbie
Posts: 56
Joined: Wed Jun 22, 2005 4:00 am
Location: USA, California

How to adjust annotation position after zoom/resize??

Post by fano » Mon Jun 05, 2006 5:36 pm

Hi,
I use color band tools and put annotations on them to give them a
description for the enduser.
When I zoom/unzoom or resize the graph I want to
adjust the position of the annotations.

The zoomed event, however, is called BEFORE the chart class is repainted
to show the new axis scales and therefore a call like:

this.annotation1.Left = chart1.Axes.Bottom.CalcXPosValue(this.ColorBand1.Start);

does not get the new value.
Is there a way to adjust the annotations to the new postion of the colorband(s)? As far as I see the colorband class does not have a label or mark associated with it. If it had, I would not need the annotations.

Thanks,
fano

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

Post by Narcís » Tue Jun 06, 2006 11:08 am

Hi fano,

You could try implementing the code in the BeforeDrawSeries event:

Code: Select all

		private void tChart1_BeforeDrawSeries(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			int left, top;
			left = line1.CalcXPos(3);
			top = line1.CalcYPos(3);
			annotation1.Left = left;
			annotation1.Top = top;
		}
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

Post Reply