Annotation tool snap to point feature

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Annotation tool snap to point feature

Post by Quant » Wed Apr 08, 2015 11:31 am

I use Annotation tool to wright a text on chart. which i wanted to mark a specific point on my series. But i didnt found any feature for this in Annotation tool. So i kept its position custom and set its x and y cordinates according to that point. It worked well but while Zooming Chart position of text doesnt change itself. how to change its position automatically i want it like snap to point.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Annotation tool snap to point feature

Post by Christopher » Thu Apr 09, 2015 9:43 am

Hello!

You can tie the Annotation tool position to a particular series point position like this:

Code: Select all

    Annotation tool1;
    Line series1;

    private void InitializeChart()
    {
      series1 = new Line(tChart1.Chart);
      series1.FillSampleValues();
      series1.AfterDrawValues += series1_AfterDrawValues;
      

      tool1 = new Annotation(tChart1.Chart);
      tool1.Text = "Some text";
      tool1.Shape.CustomPosition = true;
    }

    void series1_AfterDrawValues(object sender, Graphics3D g)
    {
      tool1.Shape.Left = series1.CalcXPos(3);
      tool1.Shape.Top = series1.CalcYPos(3);
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply