How do I the Y-value of a Series when I know the X value?
Posted: Tue Feb 17, 2009 4:32 pm
Ive a chart that displays a line.
Im using a vertical cursor (set up so it follows the mouse). I can read the x-coord by doing;
double x = mainCursor.XValue;
If I read the y-value by doing
double x = mainCursor.XValue;
then Im just getting the mouse y-coord. I want the y-coord of the line. Is there an easy way to do this. Im assuming there is a function that I can call by passing the x-coord.
One way Ive thought of doing it is this;
int X;
double Y = theChart.Series[0].YValues[X];
The problem is I know the x-coord But I dont know the x index value.
Is there a simple solution here? Thanks.
Im using a vertical cursor (set up so it follows the mouse). I can read the x-coord by doing;
double x = mainCursor.XValue;
If I read the y-value by doing
double x = mainCursor.XValue;
then Im just getting the mouse y-coord. I want the y-coord of the line. Is there an easy way to do this. Im assuming there is a function that I can call by passing the x-coord.
One way Ive thought of doing it is this;
int X;
double Y = theChart.Series[0].YValues[X];
The problem is I know the x-coord But I dont know the x index value.
Is there a simple solution here? Thanks.