How do I create text labels that point to a point on a Chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Glenn F. Henriksen
Newbie
Newbie
Posts: 52
Joined: Tue Mar 04, 2003 5:00 am

How do I create text labels that point to a point on a Chart

Post by Glenn F. Henriksen » Fri Jan 13, 2006 6:45 pm

How do I create a text label that points to an X,Y location on a Fastline

Thanks for any help you can give me.

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

Post by Narcís » Mon Jan 16, 2006 9:44 am

Hi Annelise,

You can do something like the code below on TChart's AfterDraw event.

Code: Select all

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			int MaxIndex=0;

			for (int i=0;i<fastLine1.Count;++i)
			{
				if (fastLine1.YValues[i]==fastLine1.MaxYValue()) MaxIndex=i;
			}

			int x=fastLine1.CalcXPos(MaxIndex);
			int y=fastLine1.CalcYPos(MaxIndex);;
			tChart1.Graphics3D.TextOut(x,y,"Maximum Value!");
		}
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