How To Return Y-Value of a Series?

TeeChart for ActiveX, COM and ASP
Post Reply
Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

How To Return Y-Value of a Series?

Post by Dave » 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

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 Mar 02, 2009 4:27 pm

Hi Dave,
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
I'm afraid this is the only option I can think of. You'll get all necessary parameters with the AxTeeChart.ITChartEvents_OnCursorToolChangeEvent e parameter, for example:

Code: Select all

			axTChart1.Tools.get_Items(e.tool).asTeeCursor.XVal
or:

Code: Select all

			e.xVal
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

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Post by Dave » Mon Mar 02, 2009 4:56 pm

Narcis

Sorry but you've completely lost me. Im new to working with the TeeChart software.

My compiler doesnt recognise this.

axTChart1.Tools.get_Items(e.tool).asTeeCursor.XVal


I replaced axTChart1 with Chart1 (the name of my chart) but it still doesnt recognise this code.

regards

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 Mar 02, 2009 5:02 pm

Hi Dave,

Looking at your code syntax again it makes me think you are using TeeChart for .NET. Can you please confirm this? If that's the case, could you please post your future technical inquiries at TeeChart for .NET's forum?

If you are using TeeChart for .NET you should do the same as in the All Features\Welcome !\Chart styles\Standard\Line(Strip)\Interpolating line series example in the features demo, available at TeeChart's program group. Full demo project sources can be found at C:\Program Files\Steema Software\TeeChart for .NET v3\Examples\DemoProject.

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

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Post by Dave » Tue Mar 03, 2009 9:04 am

Hi Narcis

Yes you are right it is the .NET version. I asssumed since Im developing a Windows applicaton it was be the ActiveX version. I will report on the .NET forum.
Thanks.

Post Reply