Page 1 of 1

ASP.NET and Lines

Posted: Wed Jul 27, 2005 4:41 pm
by 8120342
I need to create several webchart lines. Gann, Fib, Trend. etc. I've found that I can manually create a ..tools.drawline and manually display drawlineitems on the webchart. I'd like to allow the user to click on the chart to place a new line and then move the lines as needed.

Is it possible to Drag the lines with ASP.NET forms?
Also what would be the best way to create a gann fan?

Thanks

Posted: Thu Jul 28, 2005 9:01 am
by narcis
Hi mlouy,

DrawLine tool is not available with WebChart component, it is only available with TChart components. However you have several options as using Line series for drawing those lines or also custom drawing on the chart canvas using something like:

Code: Select all

		private void WebChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			g.Pen.Color=Color.Blue;
			g.Line(WebChart1.Chart.Axes.Left.Position,
							WebChart1.Chart.Axes.Bottom.Position,
							WebChart1.Chart.Axes.Left.Position+350,
							WebChart1.Chart.Axes.Bottom.Position-350);
		}
If you want the users to click on the chart to draw the lines you could have a look at the demo at http://www.steema.net/TeeChartForNET/index.aspx and have a look at the zooming examples. There users click on 2 points on the chart then you could use those points to draw the line. If users need to move the lines it may be more appropiate to use line series for each line.

Regarding trend lines, TeeChart already includes trend lines function so that you only have to provide this line the datasource series:

Code: Select all

		private void Page_Load(object sender, System.EventArgs e)
		{
			// Put user code to initialize the page here
			WebChart1.Chart.Series[0].FillSampleValues();
			WebChart1.Chart.Series[1].DataSource=WebChart1.Chart.Series[0];
		}
To create a Gann fan I'd use custom drawing on the chart canvas on AfterDraw event.