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?
Storing Co-ordinates of line chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ace,
Yes, you can do something like this:
Notice the Bitmap method call. It's necessary for chart being internally painted so that series screen positions have correct values.
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
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Storing Co-ordinates of line chart
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
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |