How To Return Y-Value of a Series?
Posted: Mon Mar 02, 2009 3:32 pm
Im still trying to get the point of intersection of a vertical line (Cursor Tool) and a Series on a T-Chart. Im looking for the Y-value of the Series (not a screen co-ord)
Im developing a Windows application in Visual C# (not an ASP.NET web -based app).
Ive added a TeeChart to a windows form. Its called Chart1
In the windows form constructor Ive the following code:
Chart1.Series.Add(Voltages);
mainCursor = new Steema.TeeChart.Tools.CursorTool(Chart1);
mainCursor.FollowMouse = true;
mainCursor.Style =Steema.TeeChart.Tools.CursorToolStyles.Vertical;
mainCursor.Pen.Width = 1;
mainCursor.Pen.Color = Color.Red;
mainCursor.Pen.Style = System.Drawing.Drawing2D.DashStyle.Dash;
mainCursor.Change += new CursorChangeEventHandler(mainCursor_Change);
Then in the Cursor change event:
void mainCursor_Change(object sender, CursorChangeEventArgs e) {
mainCursor.Series = voltageLines;
mainCursor.SnapToPoint();
}
If I do:
double x1 = mainCursor.XValue;
double y1 = mainCursor.YValue;
then y1 is the value of the mouse position. Not the y-intersection of the Series which is what I want.
Ive already checked this link but it doesnt help since Im not using the Chart_OnCursorToolChange event which provides 7 parameters.
http://www.teechart.net/support/viewtopic.php?t=4161
Im developing a Windows application in Visual C# (not an ASP.NET web -based app).
Ive added a TeeChart to a windows form. Its called Chart1
In the windows form constructor Ive the following code:
Chart1.Series.Add(Voltages);
mainCursor = new Steema.TeeChart.Tools.CursorTool(Chart1);
mainCursor.FollowMouse = true;
mainCursor.Style =Steema.TeeChart.Tools.CursorToolStyles.Vertical;
mainCursor.Pen.Width = 1;
mainCursor.Pen.Color = Color.Red;
mainCursor.Pen.Style = System.Drawing.Drawing2D.DashStyle.Dash;
mainCursor.Change += new CursorChangeEventHandler(mainCursor_Change);
Then in the Cursor change event:
void mainCursor_Change(object sender, CursorChangeEventArgs e) {
mainCursor.Series = voltageLines;
mainCursor.SnapToPoint();
}
If I do:
double x1 = mainCursor.XValue;
double y1 = mainCursor.YValue;
then y1 is the value of the mouse position. Not the y-intersection of the Series which is what I want.
Ive already checked this link but it doesnt help since Im not using the Chart_OnCursorToolChange event which provides 7 parameters.
http://www.teechart.net/support/viewtopic.php?t=4161