Page 1 of 1

How to adjust annotation position after zoom/resize??

Posted: Mon Jun 05, 2006 5:36 pm
by 9637279
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

Posted: Tue Jun 06, 2006 11:08 am
by narcis
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;
		}