I Cant Get Vertical Cursor Tool To Intersect
Posted: Thu Jul 30, 2009 8:49 am
Hello
Im developing a Windows application using Visual C#.
Ive a single window with a TeeChart control called tChart1. I add a line to this chart as follows and it displays OK.
Line line1 = new Line();
line1.Add(wavelengthArray, resultArray);
tChart1.Series.Add(line1);
Ive tried to add a vertical cursor tool so that when it intersects the line I can display the intersection point
This is shown below.
public myClass
{
...
...
verticalCursor = new Steema.TeeChart.Tools.CursorTool(tChart1.Chart);
verticalCursor.FollowMouse = true;
verticalCursor.Snap = true;
verticalCursor.Style = Steema.TeeChart.Tools.CursorToolStyles.Vertical;
verticalCursor.FastCursor = true;
verticalCursor.Pen.Width = 1;
verticalCursor.Pen.Color = Color.Red;
verticalCursor.Change += new CursorChangeEventHandler(verticalCursor_Change);
}
void verticalCursor_Change(object sender, CursorChangeEventArgs e) {
verticalCursor.Series = tChart1.Series[0];
// My code in here that gets the intersection point
}
The vertical cursor moves OK (it follows the mouse) but it doesnt enter the "verticalCursor_Change" function for some reason.
Is there something obvious I may not have done? Or alternatively can someone post a simple example that shows this functionality working
Thanks.
Im developing a Windows application using Visual C#.
Ive a single window with a TeeChart control called tChart1. I add a line to this chart as follows and it displays OK.
Line line1 = new Line();
line1.Add(wavelengthArray, resultArray);
tChart1.Series.Add(line1);
Ive tried to add a vertical cursor tool so that when it intersects the line I can display the intersection point
This is shown below.
public myClass
{
...
...
verticalCursor = new Steema.TeeChart.Tools.CursorTool(tChart1.Chart);
verticalCursor.FollowMouse = true;
verticalCursor.Snap = true;
verticalCursor.Style = Steema.TeeChart.Tools.CursorToolStyles.Vertical;
verticalCursor.FastCursor = true;
verticalCursor.Pen.Width = 1;
verticalCursor.Pen.Color = Color.Red;
verticalCursor.Change += new CursorChangeEventHandler(verticalCursor_Change);
}
void verticalCursor_Change(object sender, CursorChangeEventArgs e) {
verticalCursor.Series = tChart1.Series[0];
// My code in here that gets the intersection point
}
The vertical cursor moves OK (it follows the mouse) but it doesnt enter the "verticalCursor_Change" function for some reason.
Is there something obvious I may not have done? Or alternatively can someone post a simple example that shows this functionality working
Thanks.