ASP.NET FastLine Speed

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ChrisIropa
Newbie
Newbie
Posts: 4
Joined: Wed May 23, 2007 12:00 am

ASP.NET FastLine Speed

Post by ChrisIropa » Tue Jun 26, 2007 9:55 am

Hi !

I've a FastLine in a WebChart which contains 200.000 values.
It takes 8 seconds until it is displayed in my browser.
The most time is between Page_Prerender and Page_Unload.

Now I want to increase the performance, but I can't find the properties in the known Delphi-Article (FastPen, Clip, ...) in .NET Version of TeeChart.

What can I do ?

Best regards, Chris

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 Jun 29, 2007 2:04 pm

Hi Chris,
I've a FastLine in a WebChart which contains 200.000 values.
It takes 8 seconds until it is displayed in my browser.
The most time is between Page_Prerender and Page_Unload.
We have done some tests here using the same development machine as a server to avoid network load problems. We used the code below for the tests and the application was using TempChart property set to Session.

We have observed that application performance varies depending on the machine load as well. However, code below took between 1 and 3 seconds plotting the chart. Notice that we used BeforeDraw and AfterDraw events for calculating consumed time as this is the time it takes to plot the chart and where the number of series points has influence as this doesn't affect in the WebChart construction.

Also, the fastest chart loading option is setting TempChart property to File. For further information about TempChart please read Tutorial 9 - TeeChart and WebChart and ASP.NET. You'll find the tutorials at TeeChart's program group.

Code: Select all

	protected void Page_Load(object sender, EventArgs e)
	{
		LoadTime = DateTime.Now.Ticks;

		WebChart1.BeforeDraw += new Steema.TeeChart.PaintChartEventHandler(WebChart1_BeforeDraw);
		WebChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(WebChart1_AfterDraw);		

		int MaxPoints = 200000;
		Steema.TeeChart.Chart ch1 = WebChart1.Chart;

		ch1.Aspect.View3D = false;
		ch1.Title.Visible = false;
		ch1.Legend.Visible = false;
		ch1.Axes.Left.AxisPen.Width = 1;
		ch1.Axes.Bottom.AxisPen.Width = 1;
		ch1.Axes.Bottom.SetMinMax(0, MaxPoints - 1);

		Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(ch1);
		fastLine1.AutoRepaint = false;
		fastLine1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None;
		fastLine1.FillSampleValues(MaxPoints);
	}

	private long BeforeDrawTime, LoadTime, now;

	void WebChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
	{
		//calculate elapsed time
		now = DateTime.Now.Ticks;
		TimeSpan elapsedTime = new TimeSpan(now - BeforeDrawTime);
		Label1.Text = "Elapsed time BeforeDraw: " + elapsedTime.TotalMilliseconds.ToString() + " ms";

		elapsedTime = new TimeSpan(now - LoadTime);
		Label2.Text = "Elapsed time PreRender: " + elapsedTime.TotalMilliseconds.ToString() + " ms"; 

	}

	void WebChart1_BeforeDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
	{
		BeforeDrawTime = DateTime.Now.Ticks;    
	}
Now I want to increase the performance, but I can't find the properties in the known Delphi-Article (FastPen, Clip, ...) in .NET Version of TeeChart.
Yes, those properties are not available in the .NET version for now.
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

ChrisIropa
Newbie
Newbie
Posts: 4
Joined: Wed May 23, 2007 12:00 am

Post by ChrisIropa » Mon Jul 02, 2007 9:07 am

Hi !

The difference to my project is the filling method of the chart.
I use FastLine.Add(double x, double y)

Could this be the bottleneck ?

I don't know which function "FillSampleValues()" calls inside to populate the chart.


Best regards,

Chris

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 Jul 02, 2007 9:27 am

Hi Chris,

No, FillSampleValues is not the bottleneck as it ends up using Add(x,y).
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