Storing Co-ordinates of line chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Ace
Newbie
Newbie
Posts: 2
Joined: Thu Jan 17, 2008 12:00 am

Storing Co-ordinates of line chart

Post by Ace » Mon Dec 15, 2008 11:42 am

I have the following requirement in ASP.net with C#

I need to store the X and Y co- ordinates as plotted in the line chart along with the X and Y data values .

I am aware that there are methods of HotspotTool in the WebChart Tools section of Teechart component,but they all are dependent on the movement of the mouse cursor.

Are there other options to achieve the same?

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 Dec 15, 2008 2:52 pm

Hi Ace,

Yes, you can do something like this:

Code: Select all

		System.Drawing.Bitmap bmp = WebChart2.Chart.Bitmap();
		Steema.TeeChart.Styles.Series s = WebChart2.Chart.Series[0];

		for (int i = 0; i < s.Count; i++)
		{
			double xVal = s.XValues[i];
			double yVal = s.YValues[i];	
			int xPos = s.CalcXPos(i);
			int yPos = s.CalcYPos(i);
			//Save those variables as you wish
		}
Notice the Bitmap method call. It's necessary for chart being internally painted so that series screen positions have correct values.
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

Ace
Newbie
Newbie
Posts: 2
Joined: Thu Jan 17, 2008 12:00 am

Storing Co-ordinates of line chart

Post by Ace » Tue Dec 16, 2008 5:49 am

Hi Narcis,

Thank you for the prompt reply.

Well, I did try to use
System.Drawing.Bitmap bmp = WebChart2.Chart.Bitmap(); but I am getting the following 'An exception of type 'System.ArgumentException' occurred in System.Drawing.dll but was not handled in user code'.

Then I found there is an overload method which takes the width and height as the parameters.This solved the errror.

Though I will be able to pass these parameters since the graph width and height are constant, I am just curious to know why I get the Error when I do not pass any parameters to the Bitmap method

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Dec 16, 2008 8:57 am

Hi Ace,

You may be using an old version of TeeChart. Could you please check you are using latest version available at the client download area?

Thanks in advance.
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