I've added the possibility to add a new property to control whether the arrow is draw from/to the annotation (TF02015572). In the meanwhile you could draw the arrow manually. Here is how I modified your project to do it:
Code: Select all
public TeeChartSandbox()
{
//...
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
}
void tChart1_MouseClick(object sender, MouseEventArgs e)
{
//...
//annotation1.Callout.Arrow.Visible = true;
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
Point tmpTo = new Point(annotation1.Callout.XPosition, annotation1.Callout.YPosition);
Point tmpFrom = CloserPoint(annotation1.Shape.ShapeBounds, tmpTo);
g.Brush.Color = annotation1.Callout.Color;
g.Arrow(true, tmpFrom, tmpTo, annotation1.Callout.ArrowHeadSize, annotation1.Callout.ArrowHeadSize, annotation1.Callout.ZPosition);
}
Point CloserPoint(Rectangle R, Point P)
{
int tmpX, tmpY;
if (P.X > R.Right) tmpX = R.Right;
else
if (P.X < R.Left) tmpX = R.Left;
else tmpX = (R.Left + R.Right) / 2;
if (P.Y > R.Bottom) tmpY = R.Bottom;
else
if (P.Y < R.Top) tmpY = R.Top;
else tmpY = (R.Top + R.Bottom) / 2;
return (new Point(tmpX, tmpY));
}