Page 1 of 1

Can we mark an area of the chart?

Posted: Fri Nov 10, 2006 2:22 am
by 9642531
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.

Posted: Fri Nov 10, 2006 12:19 pm
by narcis
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;
		}