Can we mark an area of the chart?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
sherlyn
Newbie
Newbie
Posts: 8
Joined: Tue Sep 19, 2006 12:00 am

Can we mark an area of the chart?

Post by sherlyn » Fri Nov 10, 2006 2:22 am

Hi Narcis,

Can we mark an are of chart which may be of interest. Like for a particular point in the chart, can we circle it and label it?

I've attached the picture of what I'm trying to describe in a mail to you as I'm unable to connect to the newsgroup.

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 Nov 10, 2006 12:19 pm

Hi sherlyn,

Yes, to mark the point as the image you sent you need to use the AfterDraw event to custom draw on TeeChart's canvas. For labelling the point you can use AnnotationTool. For example:

Code: Select all

		private void Form1_Load(object sender, EventArgs e)
		{
			tChart1.Aspect.View3D = false;
			points1.FillSampleValues();
		}

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			g.Pen.Visible = true;
			g.Pen.Color = points1.Color;
			g.Ellipse(r);			
		}

		private Rectangle r;

		private void points1_AfterDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			r = new Rectangle();

			int radius = 20;

			r.X = points1.CalcXPos(5) - radius;
			r.Y = points1.CalcYPos(5) - radius;
			r.Width = radius * 2;
			r.Height = r.Width;

			Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
			annotation1.Text = "5th point";
			annotation1.Left = r.X;
			annotation1.Top = r.Y + r.Height + 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