Page 1 of 1

A line connecting the (base) points of an arrow series

Posted: Thu Oct 27, 2005 2:18 pm
by 9088874
Hi

I have an arrow series in 2-d.

I want to know if it is possible to draw a line that joins all the base (XStart,YStart) points.

I realise that I could have two series: an arrow series and a line series, both filled with the same data.

I am hoping that it is possible to have just the one series, as I allow my users to move the arrows around, at it gets messy having to write code that moves the one series points to follow the other's.

Regards
Reg Bust

Posted: Fri Oct 28, 2005 2:10 pm
by narcis
Hi Reg,

Yes, you can custom draw on TeeChart's canvas at its AfterDraw event:

Code: Select all

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			int c=tChart1.Axes.Depth.IAxisSize/2; //When not 3D is 0.
			g.ClipRectangle(tChart1.Chart.ChartBounds);
			for (int i=0;i<arrow1.Count-1;++i)
			{
				tChart1.Graphics3D.Pen.Color=Color.Blue;
				tChart1.Graphics3D.MoveTo(arrow1.CalcXPos(i)+c,arrow1.CalcYPos(i)-c);
				tChart1.Graphics3D.LineTo(arrow1.CalcXPos(i+1)+c,arrow1.CalcYPos(i+1)-c);
			}
			g.UnClip();
		}

Posted: Mon Oct 31, 2005 6:52 am
by 9088874
Thank you.

Much appreciated.