Provision to drag the annotation text in annotation tool

Ideas and wishes for TeeChart
Post Reply
Lakshmi
Newbie
Newbie
Posts: 40
Joined: Fri Oct 07, 2005 4:00 am
Location: India
Contact:

Provision to drag the annotation text in annotation tool

Post by Lakshmi » Thu Mar 16, 2006 9:44 am

There should be a feature which will allow the user/client to drag the annotation text (label) and the connecting line should move automatically.
I know that we can stretch/drag the connecting line but there is no way to drag the annotation text.

Thanks

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

Post by Narcís » Fri Mar 17, 2006 10:10 am

Hi Lakshmi,

This can actually be easily done doing something like this:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      line1.FillSampleValues();
      Bitmap bmp = tChart1.Bitmap; //Trick to force the chart being drawn and annotation arrow being positioned
    }

    private bool StartDrag = false;

    private void annotation1_Click(object sender, MouseEventArgs e)
    {
      StartDrag = !StartDrag;
    }

    private void tChart1_MouseMove(object sender, MouseEventArgs e)
    {
      if (StartDrag)
      {
        annotation1.Left = e.X;
        annotation1.Top = e.Y;
      }
    }

    private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    {
      annotation1.Callout.Arrow.Visible = true;
      annotation1.Callout.XPosition = line1.CalcXPos(5);
      annotation1.Callout.YPosition = line1.CalcYPos(5);
    }
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